]> xenbits.xensource.com Git - people/vhanquez/xen-unstable.git/commitdiff
libxl: fix free of uninitialised "disks" variable
authorYang Z Zhang <yang.z.zhang@intel.com>
Wed, 5 Jan 2011 23:37:32 +0000 (23:37 +0000)
committerYang Z Zhang <yang.z.zhang@intel.com>
Wed, 5 Jan 2011 23:37:32 +0000 (23:37 +0000)
Reported-by: Wei Huang <wei.huang2@amd.com>
Reported-by: Christoph Egger <Christoph.Egger@amd.com>
Author: Yang Z Zhang <yang.z.zhang@intel.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.c

index 68889b9aa243750c9b0591b878e4989fb76c20f9..2c3fb0f72f1228b18c266a8962f65d0bf0aa7e3d 100644 (file)
@@ -1402,8 +1402,8 @@ static char ** libxl_build_device_model_args_new(libxl__gc *gc,
             }
             libxl_device_disk_destroy(&disks[i]);
         }
+        free(disks);
     }
-    free(disks);
     flexarray_set(dm_args, num++, NULL);
     return (char **) flexarray_contents(dm_args);
 }