mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 02:51:16 +00:00
avoid a double-free bug
* src/qemu_conf.c (qemudParseXML): Ensure that "obj" is either NULL or a valid malloc'd pointer before we might "goto error" where it is freed.
This commit is contained in:
parent
65c2738ea1
commit
0dc23afb0c
@ -1,3 +1,10 @@
|
|||||||
|
Fri May 16 11:29:30 CEST 2008 Jim Meyering <meyering@redhat.com>
|
||||||
|
|
||||||
|
avoid a double-free bug
|
||||||
|
* src/qemu_conf.c (qemudParseXML): Ensure that "obj" is either
|
||||||
|
NULL or a valid malloc'd pointer before we might "goto error"
|
||||||
|
where it is freed.
|
||||||
|
|
||||||
Thu May 15 16:06:08 EST 2008 Daniel P. Berrange <berrange@redhat.com>
|
Thu May 15 16:06:08 EST 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
* src/qemu_conf.c: Remove use of strcmp()
|
* src/qemu_conf.c: Remove use of strcmp()
|
||||||
|
@ -1736,6 +1736,7 @@ static struct qemud_vm_def *qemudParseXML(virConnectPtr conn,
|
|||||||
} else {
|
} else {
|
||||||
strcpy(def->os.type, (const char *)obj->stringval);
|
strcpy(def->os.type, (const char *)obj->stringval);
|
||||||
xmlXPathFreeObject(obj);
|
xmlXPathFreeObject(obj);
|
||||||
|
obj = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!virCapabilitiesSupportsGuestOSType(driver->caps, def->os.type)) {
|
if (!virCapabilitiesSupportsGuestOSType(driver->caps, def->os.type)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user