1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

conf: Don't leak 'primary' video property on error

It's only freed on normal returns from virDomainVideoDefParseXML,
but not when erroring out.
This commit is contained in:
Christophe Fergeau 2013-02-21 16:21:31 +01:00
parent 058273d096
commit 9879fce9f6

View File

@ -7662,9 +7662,11 @@ virDomainVideoDefParseXML(const xmlNodePtr node,
vram = virXMLPropString(cur, "vram");
heads = virXMLPropString(cur, "heads");
if ((primary = virXMLPropString(cur, "primary")) != NULL)
if ((primary = virXMLPropString(cur, "primary")) != NULL) {
if (STREQ(primary, "yes"))
def->primary = 1;
VIR_FREE(primary);
}
def->accel = virDomainVideoAccelDefParseXML(cur);
}
@ -7728,7 +7730,6 @@ virDomainVideoDefParseXML(const xmlNodePtr node,
VIR_FREE(ram);
VIR_FREE(vram);
VIR_FREE(heads);
VIR_FREE(primary);
return def;