提交 586a5bc0 编写于 作者: M Michal Privoznik 提交者: Ján Tomko

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 3e8343e1)
上级 e0152c1e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册