aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-08-11 22:12:11 +0000
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-08-11 22:12:11 +0000
commit3184c77cda6a4abec7c859ac9fabf0080bbd9eb4 (patch)
tree7e98bacf52b152262920be169239dfcbedf7c1aa
parent7880142fc739a0bd9b6e2ca703f4da88952580ba (diff)
downloadxen-3184c77cda6a4abec7c859ac9fabf0080bbd9eb4.tar.gz
xen-3184c77cda6a4abec7c859ac9fabf0080bbd9eb4.tar.bz2
xen-3184c77cda6a4abec7c859ac9fabf0080bbd9eb4.zip
Memory leak in xc_linux_save, and uninitialised var
in secpol_tool. Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
-rw-r--r--tools/libxc/xc_linux_save.c14
-rw-r--r--tools/security/secpol_tool.c2
2 files changed, 14 insertions, 2 deletions
diff --git a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c
index 930002f684..c2a6af5f13 100644
--- a/tools/libxc/xc_linux_save.c
+++ b/tools/libxc/xc_linux_save.c
@@ -429,7 +429,7 @@ int xc_linux_save(int xc_handle, int io_fd, u32 dom)
- that should be sent this iteration (unless later marked as skip);
- to skip this iteration because already dirty;
- to fixup by sending at the end if not already resent; */
- unsigned long *to_send, *to_skip, *to_fix;
+ unsigned long *to_send = NULL, *to_skip = NULL, *to_fix = NULL;
xc_shadow_control_stats_t stats;
@@ -1054,6 +1054,18 @@ int xc_linux_save(int xc_handle, int io_fd, u32 dom)
if (pfn_type != NULL)
free(pfn_type);
+ if (pfn_batch != NULL)
+ free(pfn_batch);
+
+ if (to_send != NULL)
+ free(to_send);
+
+ if (to_fix != NULL)
+ free(to_fix);
+
+ if (to_skip != NULL)
+ free(to_skip);
+
DPRINTF("Save exit rc=%d\n",rc);
return !!rc;
}
diff --git a/tools/security/secpol_tool.c b/tools/security/secpol_tool.c
index 6c1e5f0fc8..f7a084eb77 100644
--- a/tools/security/secpol_tool.c
+++ b/tools/security/secpol_tool.c
@@ -612,7 +612,7 @@ void usage(char *progname)
int main(int argc, char **argv)
{
- int acm_cmd_fd, ret;
+ int acm_cmd_fd, ret = 0;
if (argc < 2)
usage(argv[0]);