mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 23:25:24 +00:00
qemu: avoid dereferencing a NULL pointer
* src/qemu/qemu_process.c: Taking if (qemuDomainObjEndJob(driver, obj) == 0) true branch then 'obj' is NULL, virDomainObjIsActive(obj) and virDomainObjUnref(obj) will dereference NULL pointer. Signed-off-by: Alex Jia <ajia@redhat.com>
This commit is contained in:
parent
42b23434b0
commit
d93a08eb47
@ -2661,6 +2661,7 @@ error:
|
|||||||
if (qemuDomainObjEndJob(driver, obj) == 0)
|
if (qemuDomainObjEndJob(driver, obj) == 0)
|
||||||
obj = NULL;
|
obj = NULL;
|
||||||
|
|
||||||
|
if (obj) {
|
||||||
if (!virDomainObjIsActive(obj)) {
|
if (!virDomainObjIsActive(obj)) {
|
||||||
if (virDomainObjUnref(obj) > 0)
|
if (virDomainObjUnref(obj) > 0)
|
||||||
virDomainObjUnlock(obj);
|
virDomainObjUnlock(obj);
|
||||||
@ -2678,6 +2679,7 @@ error:
|
|||||||
else
|
else
|
||||||
virDomainObjUnlock(obj);
|
virDomainObjUnlock(obj);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
qemuDriverUnlock(driver);
|
qemuDriverUnlock(driver);
|
||||||
|
|
||||||
virConnectClose(conn);
|
virConnectClose(conn);
|
||||||
|
Loading…
Reference in New Issue
Block a user