mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 20:02:21 +00:00
vmware: Fix some initialization problems
Don't leak guest if adding it to virCapabilities fails. Also return NULL and not pointer to free'd object with zero references in such case. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
e8e9a7e9f7
commit
97a84a9344
@ -105,14 +105,15 @@ vmwareCapsInit(void)
|
|||||||
VIR_DOMAIN_VIRT_VMWARE,
|
VIR_DOMAIN_VIRT_VMWARE,
|
||||||
NULL, NULL, 0, NULL) == NULL)
|
NULL, NULL, 0, NULL) == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
guest = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return caps;
|
return caps;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
virCapabilitiesFreeGuest(guest);
|
||||||
virObjectUnref(caps);
|
virObjectUnref(caps);
|
||||||
goto cleanup;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user