]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuMonitorJSONSendKey: Avoid double free
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 2 Oct 2013 16:18:13 +0000 (18:18 +0200)
committerJán Tomko <jtomko@redhat.com>
Tue, 15 Oct 2013 14:03:37 +0000 (16:03 +0200)
After successful @cmd construction the memory where @keys points to is
part of @cmd. Avoid double freeing it.
(cherry picked from commit 3e8343e1510741623aa5bc1dfb74ec39fde868dd)

src/qemu/qemu_monitor_json.c

index 88a0dc9dfbfd362aef0eef4721b5d019dae5f610..ab9d451dd216eb462072eff0b290e0bfb7f2d64c 100644 (file)
@@ -3440,6 +3440,9 @@ int qemuMonitorJSONSendKey(qemuMonitorPtr mon,
     if (!cmd)
         goto cleanup;
 
+    /* @keys is part of @cmd now. Avoid double free */
+    keys = NULL;
+
     if ((ret = qemuMonitorJSONCommand(mon, cmd, &reply)) < 0)
         goto cleanup;