[PATCH] util: don't free dmidecode path string before printing it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The path was freed before printing the error message, resulting in:
error : virSysinfoRead:773 : internal error Failed to execute command
(null)
---
 src/util/sysinfo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
index 92c3539..8ecd1e3 100644
--- a/src/util/sysinfo.c
+++ b/src/util/sysinfo.c
@@ -765,7 +765,6 @@ 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,
@@ -796,6 +795,7 @@ virSysinfoRead(void) {
         goto no_memory;
 
 cleanup:
+    VIR_FREE(path);
     VIR_FREE(outbuf);
     virCommandFree(cmd);
 
-- 
1.7.8.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]