1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-26 03:21:44 +03:00

vboxDomainDumpXML: avoid a leak on OOM error path

* src/vbox/vbox_tmpl.c (vboxDomainDumpXML): Free vboxCallback buffer
upon OOM.
This commit is contained in:
Jim Meyering 2010-02-15 20:09:55 +01:00
parent e977f471f1
commit dc03ae2c6d

View File

@ -5276,10 +5276,11 @@ static nsresult vboxCallbackQueryInterface(nsISupports *pThis, const nsID *iid,
static IVirtualBoxCallback *vboxAllocCallbackObj(void) {
IVirtualBoxCallback *vboxCallback = NULL;
/* Allocate, Initialize and return a validi
/* Allocate, Initialize and return a valid
* IVirtualBoxCallback object here
*/
if ((VIR_ALLOC(vboxCallback) < 0) || (VIR_ALLOC(vboxCallback->vtbl) < 0)) {
VIR_FREE(vboxCallback);
virReportOOMError();
return NULL;
}