1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 07:59:00 +00:00

qemuMonitorJSONSendKey: Avoid double free

After successful @cmd construction the memory where @keys points to is
part of @cmd. Avoid double freeing it.
This commit is contained in:
Michal Privoznik 2013-10-02 18:18:13 +02:00
parent ec07a9e84b
commit 3e8343e151

View File

@ -3452,6 +3452,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;