ia64/xen-unstable

changeset 6130:f507ca15ae00

Memory leak in xc_linux_save, and uninitialised var
in secpol_tool.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Aug 11 22:12:11 2005 +0000 (2005-08-11)
parents 5ec5f6960507
children 194f6230b62c
files tools/libxc/xc_linux_save.c tools/security/secpol_tool.c
line diff
     1.1 --- a/tools/libxc/xc_linux_save.c	Thu Aug 11 21:52:22 2005 +0000
     1.2 +++ b/tools/libxc/xc_linux_save.c	Thu Aug 11 22:12:11 2005 +0000
     1.3 @@ -429,7 +429,7 @@ int xc_linux_save(int xc_handle, int io_
     1.4         - that should be sent this iteration (unless later marked as skip); 
     1.5         - to skip this iteration because already dirty;
     1.6         - to fixup by sending at the end if not already resent; */
     1.7 -    unsigned long *to_send, *to_skip, *to_fix;
     1.8 +    unsigned long *to_send = NULL, *to_skip = NULL, *to_fix = NULL;
     1.9      
    1.10      xc_shadow_control_stats_t stats;
    1.11  
    1.12 @@ -1054,6 +1054,18 @@ int xc_linux_save(int xc_handle, int io_
    1.13      if (pfn_type != NULL) 
    1.14          free(pfn_type);
    1.15  
    1.16 +    if (pfn_batch != NULL)
    1.17 +        free(pfn_batch);
    1.18 +
    1.19 +    if (to_send != NULL)
    1.20 +        free(to_send);
    1.21 +
    1.22 +    if (to_fix != NULL)
    1.23 +        free(to_fix);
    1.24 +
    1.25 +    if (to_skip != NULL)
    1.26 +       free(to_skip);
    1.27 +
    1.28      DPRINTF("Save exit rc=%d\n",rc);
    1.29      return !!rc;
    1.30  }
     2.1 --- a/tools/security/secpol_tool.c	Thu Aug 11 21:52:22 2005 +0000
     2.2 +++ b/tools/security/secpol_tool.c	Thu Aug 11 22:12:11 2005 +0000
     2.3 @@ -612,7 +612,7 @@ void usage(char *progname)
     2.4  int main(int argc, char **argv)
     2.5  {
     2.6  
     2.7 -    int acm_cmd_fd, ret;
     2.8 +    int acm_cmd_fd, ret = 0;
     2.9  
    2.10      if (argc < 2)
    2.11          usage(argv[0]);