qemu: fix crash in qemuOpen

If the path part of connection URI is not present, cfg is used
unitialized.

https://bugzilla.redhat.com/show_bug.cgi?id=950855
This commit is contained in:
Ján Tomko 2013-04-11 11:37:25 +02:00
parent 4e54714c72
commit 74bff25090

View 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")) {