提交 74bff250 编写于 作者: J Ján Tomko

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
上级 4e54714c
...@@ -1026,6 +1026,7 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn, ...@@ -1026,6 +1026,7 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn,
goto cleanup; goto cleanup;
} }
cfg = virQEMUDriverGetConfig(qemu_driver);
if (conn->uri->path == NULL) { if (conn->uri->path == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("no QEMU URI path given, try %s"), _("no QEMU URI path given, try %s"),
...@@ -1033,7 +1034,6 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn, ...@@ -1033,7 +1034,6 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn,
goto cleanup; goto cleanup;
} }
cfg = virQEMUDriverGetConfig(qemu_driver);
if (cfg->privileged) { if (cfg->privileged) {
if (STRNEQ(conn->uri->path, "/system") && if (STRNEQ(conn->uri->path, "/system") &&
STRNEQ(conn->uri->path, "/session")) { STRNEQ(conn->uri->path, "/session")) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册