提交 03da89d1 编写于 作者: E Eric Blake

util: don't print free'd dmidecode path

The path was freed before printing the error message, resulting in:
error : virSysinfoRead:773 : internal error Failed to execute command
(null)
But virCommandRun already gives a better error message.

* src/util/sysinfo.c (virSysinfoRead): Avoid overwriting error.
上级 26cae4b4
...@@ -767,12 +767,8 @@ virSysinfoRead(void) { ...@@ -767,12 +767,8 @@ virSysinfoRead(void) {
cmd = virCommandNewArgList(path, "-q", "-t", "0,1,4,17", NULL); cmd = virCommandNewArgList(path, "-q", "-t", "0,1,4,17", NULL);
VIR_FREE(path); VIR_FREE(path);
virCommandSetOutputBuffer(cmd, &outbuf); virCommandSetOutputBuffer(cmd, &outbuf);
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0)
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to execute command %s"),
path);
goto cleanup; goto cleanup;
}
if (VIR_ALLOC(ret) < 0) if (VIR_ALLOC(ret) < 0)
goto no_memory; goto no_memory;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册