]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix memory leak parsing 'relabel' attribute in domain security XML
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 31 Aug 2011 15:52:25 +0000 (16:52 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 31 Aug 2011 16:51:09 +0000 (17:51 +0100)
* src/conf/domain_conf.c: Free the 'relabel' attribute

src/conf/domain_conf.c

index 44212cf2d009699192216da526c8f938c9f0b981..00212db08beab4d0b00759229eab1ac86c26e6a8 100644 (file)
@@ -5300,8 +5300,10 @@ virSecurityLabelDefParseXML(const virDomainDefPtr def,
         } else {
             virDomainReportError(VIR_ERR_XML_ERROR,
                                  _("invalid security relabel value %s"), p);
+            VIR_FREE(p);
             goto error;
         }
+        VIR_FREE(p);
         if (def->seclabel.type == VIR_DOMAIN_SECLABEL_DYNAMIC &&
             def->seclabel.norelabel) {
             virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED,