]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vmx: fix resource leak
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Fri, 4 May 2012 14:42:09 +0000 (10:42 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Fri, 4 May 2012 14:42:09 +0000 (10:42 -0400)
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.

src/vmx/vmx.c

index 4324bb8387951a681fe45afdcd222049321f0cf7..3de706293a201c23741e6c6811e8c924862b7660 100644 (file)
@@ -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);