mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
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 <ajia@redhat.com>
This commit is contained in:
parent
d02c4a1877
commit
6196fd1c28
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user