]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vboxDomainDumpXML: avoid a leak on OOM error path
authorJim Meyering <meyering@redhat.com>
Mon, 15 Feb 2010 19:09:55 +0000 (20:09 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 16 Feb 2010 16:49:05 +0000 (17:49 +0100)
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML): Free vboxCallback buffer
upon OOM.

src/vbox/vbox_tmpl.c

index d1a701e6184fc4a3b24cc7f4780f7d5de04971ec..8a9af523309235f23fa3df347ed847db50d8dac8 100644 (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;
     }