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.
This commit is contained in:
Eric Blake 2012-09-18 17:34:25 -06:00
parent 26cae4b4ce
commit 03da89d141

View File

@ -767,12 +767,8 @@ virSysinfoRead(void) {
cmd = virCommandNewArgList(path, "-q", "-t", "0,1,4,17", NULL);
VIR_FREE(path);
virCommandSetOutputBuffer(cmd, &outbuf);
if (virCommandRun(cmd, NULL) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to execute command %s"),
path);
if (virCommandRun(cmd, NULL) < 0)
goto cleanup;
}
if (VIR_ALLOC(ret) < 0)
goto no_memory;