mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-12 14:41:29 +00:00
qemuMonitorJSONSendKey: Avoid double free
After successful @cmd construction the memory where @keys points to is part of @cmd. Avoid double freeing it. (cherry picked from commit 3e8343e1510741623aa5bc1dfb74ec39fde868dd)
This commit is contained in:
parent
168f70cfe9
commit
5b2b4d5e63
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user