From: Stefan Berger Date: Fri, 4 May 2012 14:42:09 +0000 (-0400) Subject: vmx: fix resource leak X-Git-Tag: v0.9.12-rc2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=409a637eb1dc99ac1b85d3876302f876cb38a536;p=thirdparty%2Flibvirt.git vmx: fix resource leak Error: RESOURCE_LEAK: /libvirt/src/vmx/vmx.c:2431: alloc_fn: Calling allocation function "calloc". /libvirt/src/vmx/vmx.c:2431: var_assign: Assigning: "networkName" = storage returned from "calloc(1UL, 1UL)". /libvirt/src/vmx/vmx.c:2495: leaked_storage: Variable "networkName" going out of scope leaks the storage it points to. --- diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 4324bb8387..3de706293a 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2485,6 +2485,7 @@ virVMXParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def) *def = NULL; } + VIR_FREE(networkName); VIR_FREE(connectionType); VIR_FREE(addressType); VIR_FREE(generatedAddress);