From: ajia@redhat.com Date: Mon, 19 Sep 2011 02:34:06 +0000 (+0800) Subject: vmx: avoid memory leak X-Git-Tag: v0.9.5~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6196fd1c28ce6dffb6f37e4f8863fb0f6d7d550b;p=thirdparty%2Flibvirt.git vmx: avoid memory leak * src/vmx/vmx.c: fix memory leak, 'def' has a initial value 'NULL', so 'goto cleanup' is perfected instead of adding a virConfFree before 'return NULL'. Signed-off-by: Alex Jia --- diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index dff3599403..be91c13ef7 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -1253,7 +1253,7 @@ virVMXParseConfig(virVMXContext *ctx, virCapsPtr caps, const char *vmx) /* Allocate domain def */ if (VIR_ALLOC(def) < 0) { virReportOOMError(); - return NULL; + goto cleanup; } def->virtType = VIR_DOMAIN_VIRT_VMWARE;