diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 7f3e0a6012..18abf22f91 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -3450,6 +3450,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;