]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix leak in virDomainVcpuPinDefParseXML parsing cpumask
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 24 Sep 2013 15:11:39 +0000 (16:11 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 25 Sep 2013 14:49:12 +0000 (15:49 +0100)
If the virBitmapParse method fails due to OOM, we leak
the 'tmp' variable string.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/conf/domain_conf.c

index 002b980b23664c793ffeb599fb5fc68c586fbadd..cee0c93d26ef2e7ef1673fb0dcbb58a20400a03e 100644 (file)
@@ -10616,8 +10616,10 @@ virDomainVcpuPinDefParseXML(const xmlNodePtr node,
         int cpumasklen = VIR_DOMAIN_CPUMASK_LEN;
 
         if (virBitmapParse(set, 0, &def->cpumask,
-                           cpumasklen) < 0)
-           goto error;
+                           cpumasklen) < 0) {
+            VIR_FREE(tmp);
+            goto error;
+        }
         VIR_FREE(tmp);
     } else {
         virReportError(VIR_ERR_INTERNAL_ERROR,