WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Memory leak in xc_linux_save, and uninitialised var

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Memory leak in xc_linux_save, and uninitialised var
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 11 Aug 2005 18:10:09 -0400
Delivery-date: Thu, 11 Aug 2005 22:10:37 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID f507ca15ae003218b07c84aa390041d2316ed2bf
# Parent  5ec5f6960507cf731a53beb593c1e18e538036b2
Memory leak in xc_linux_save, and uninitialised var
in secpol_tool.
Signed-off-by: Jerone Young <jyoung5@xxxxxxxxxx>

diff -r 5ec5f6960507 -r f507ca15ae00 tools/libxc/xc_linux_save.c
--- a/tools/libxc/xc_linux_save.c       Thu Aug 11 21:52:22 2005
+++ b/tools/libxc/xc_linux_save.c       Thu Aug 11 22:12:11 2005
@@ -429,7 +429,7 @@
        - 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 @@
     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 -r 5ec5f6960507 -r f507ca15ae00 tools/security/secpol_tool.c
--- a/tools/security/secpol_tool.c      Thu Aug 11 21:52:22 2005
+++ b/tools/security/secpol_tool.c      Thu Aug 11 22:12:11 2005
@@ -612,7 +612,7 @@
 int main(int argc, char **argv)
 {
 
-    int acm_cmd_fd, ret;
+    int acm_cmd_fd, ret = 0;
 
     if (argc < 2)
         usage(argv[0]);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Memory leak in xc_linux_save, and uninitialised var, Xen patchbot -unstable <=