]> xenbits.xensource.com Git - 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, 11 Apr 2013 09:41:22 +0000 (11:41 +0200)
If the path part of connection URI is not present, cfg is used
unitialized.

https://bugzilla.redhat.com/show_bug.cgi?id=950855

src/qemu/qemu_driver.c

index 2c0d7d1135f04acead5044f98f1c7a7c7baba857..0d41e39d486f529d14ef61514f3501749b66e823 100644 (file)
@@ -1026,6 +1026,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"),
@@ -1033,7 +1034,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")) {