]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: fix crash in qemuOpen
authorJán Tomko <jtomko@redhat.com>
Thu, 11 Apr 2013 09:37:25 +0000 (11:37 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 9 May 2013 13:52:41 +0000 (15:52 +0200)
If the path part of connection URI is not present, cfg is used
unitialized.

https://bugzilla.redhat.com/show_bug.cgi?id=950855
(cherry picked from commit 74bff2509080912ea8abf1de8fd95fa2412b659a)

src/qemu/qemu_driver.c

index 32b05229fc82e789e95c77c61324744bab292d9d..b19f4976f6fe71cd27ca045d8d7329ba9ee527b8 100644 (file)
@@ -1016,6 +1016,7 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn,
             goto cleanup;
         }
 
+        cfg = virQEMUDriverGetConfig(qemu_driver);
         if (conn->uri->path == NULL) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("no QEMU URI path given, try %s"),
@@ -1023,7 +1024,6 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn,
             goto cleanup;
         }
 
-        cfg = virQEMUDriverGetConfig(qemu_driver);
         if (cfg->privileged) {
             if (STRNEQ(conn->uri->path, "/system") &&
                 STRNEQ(conn->uri->path, "/session")) {