Skip to contentSkip to conversation

some memory leaks in tools

PATCH james 1 participant 1 message Dec 9, 2008 Arm/actions semi architecture

lore
Share & tools
lore

james

author
#0 lore raw
tools/python/xen/lowlevel/acm/acm.c Tue Dec 09 13:14:44 2008 +0800 renamed from tools/python/xen/lowlevel/acm/acm.c Fri Dec 05 17:39:58 2008 +0800 +2 -0
diff -r 128086d44a42 tools/python/xen/lowlevel/acm/acm.c
@@ -68,6 +68,8 @@
         goto out2;
     } else {
         *buflen = SSID_BUFFER_SIZE;
+        free(buf);
+        buf = NULL;
         goto out2;
     }
  out2:
tools/python/xen/lowlevel/flask/flask.c Tue Dec 09 13:14:44 2008 +0800 renamed from tools/python/xen/lowlevel/flask/flask.c Fri Dec 05 17:39:58 2008 +0800 +1 -0
diff -r 128086d44a42 tools/python/xen/lowlevel/flask/flask.c
@@ -55,6 +55,7 @@
     xc_handle = xc_interface_open();
     if (xc_handle < 0) {
         errno = xc_handle;
+        free(buf);
         return PyErr_SetFromErrno(xc_error_obj);
     }
 
tools/python/xen/lowlevel/xc/xc.c Tue Dec 09 13:14:44 2008 +0800 renamed from tools/python/xen/lowlevel/xc/xc.c Fri Dec 05 17:39:58 2008 +0800 +3 -0
diff -r 128086d44a42 tools/python/xen/lowlevel/xc/xc.c
@@ -690,7 +690,10 @@
 
     group_str = calloc(num_sdevs, sizeof(dev_str));
     if (group_str == NULL)
+    {
+        free(sdev_array);
         return PyErr_NoMemory();
+     }
 
     for ( i = 0; i < num_sdevs; i++ )
     {