]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
util: don't print free'd dmidecode path
authorEric Blake <eblake@redhat.com>
Tue, 18 Sep 2012 23:34:25 +0000 (17:34 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 18 Sep 2012 23:48:08 +0000 (17:48 -0600)
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.

src/util/sysinfo.c

index 92c35395fd831767a9a0e76ad5c3210e5cf8c740..7f0a45b5ca291e61a9c32f12e7188b348822fccd 100644 (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;