]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_monitor_text: Drop unused variable and avoid crash
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 6 Dec 2019 09:27:08 +0000 (10:27 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 6 Dec 2019 09:29:46 +0000 (10:29 +0100)
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>
src/qemu/qemu_monitor_text.c

index 9054682d608b13347880f36cacd0e023151322e6..b38723582148b794fc7749ccc1400e54bf8d7313 100644 (file)
@@ -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;