[libvirt] [PATCH] qemu_monitor_text: Drop unused variable and avoid crash

Michal Privoznik posted 1 patch 4 years, 4 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/4c53267b70fc5c548b6530113c3f96870d8d7fc1.1575624594.git.mprivozn@redhat.com
src/qemu/qemu_monitor_text.c | 2 --
1 file changed, 2 deletions(-)
[libvirt] [PATCH] qemu_monitor_text: Drop unused variable and avoid crash
Posted by Michal Privoznik 4 years, 4 months ago
In v5.8.0-rc1~122 we've removed the only use of @safename in
qemuMonitorTextLoadSnapshot(). What we are left with is an
declared but not initialized variable that is passed to
VIR_FREE().

Caught by libvirt-php test suite.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---

Pushed under trivial rule.

 src/qemu/qemu_monitor_text.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 9054682d60..b387235821 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -161,7 +161,6 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name)
     char *cmd = NULL;
     char *reply = NULL;
     int ret = -1;
-    char *safename;
 
     cmd = g_strdup_printf("loadvm \"%s\"", name);
 
@@ -194,7 +193,6 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name)
     ret = 0;
 
  cleanup:
-    VIR_FREE(safename);
     VIR_FREE(cmd);
     VIR_FREE(reply);
     return ret;
-- 
2.23.0

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