Commit 075523438 added a direct reference to @cookie even though
it may be NULL as shown by a comment a few lines previous - so add
the check here as well.

Found by Coverity

Signed-off-by: John Ferlan <jfer...@redhat.com>
---
 src/qemu/qemu_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d17c18705b..56fcba8b2c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6831,7 +6831,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
         qemuDomainFixupCPUs(vm, &cookie->cpu) < 0)
         goto cleanup;
 
-    if (!cookie->slirpHelper)
+    if (cookie && !cookie->slirpHelper)
         priv->disableSlirp = true;
 
     if (qemuProcessStart(conn, driver, vm, cookie ? cookie->cpu : NULL,
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to