mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: Avoid use after free in qemuCaps parsing
This commit is contained in:
parent
4e3a1c3021
commit
aeed51f775
@ -264,12 +264,13 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
|
||||
char *str = virXMLPropString(nodes[i], "name");
|
||||
if (str) {
|
||||
int flag = qemuCapsTypeFromString(str);
|
||||
VIR_FREE(str);
|
||||
if (flag < 0) {
|
||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unknown qemu capabilities flag %s"), str);
|
||||
VIR_FREE(str);
|
||||
goto error;
|
||||
}
|
||||
VIR_FREE(str);
|
||||
qemuCapsSet(qemuCaps, flag);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user