提交 674d3822 编写于 作者: D Dr. David Alan Gilbert 提交者: Michael Roth

hmp/vnc: Fix info vnc list leak

We're iterating the list, and then freeing the iteration pointer rather
than the list head.

Fixes: 0a9667ec ("hmp: Update info vnc")
Reported-by: Coverity (CID 1421932)
Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20200323120822.51266-1-dgilbert@redhat.com>
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
(cherry picked from commit d4ff1093)
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 5ff78dc9
......@@ -729,10 +729,11 @@ static void hmp_info_vnc_servers(Monitor *mon, VncServerInfo2List *server)
void hmp_info_vnc(Monitor *mon, const QDict *qdict)
{
VncInfo2List *info2l;
VncInfo2List *info2l, *info2l_head;
Error *err = NULL;
info2l = qmp_query_vnc_servers(&err);
info2l_head = info2l;
if (err) {
hmp_handle_error(mon, &err);
return;
......@@ -761,7 +762,7 @@ void hmp_info_vnc(Monitor *mon, const QDict *qdict)
info2l = info2l->next;
}
qapi_free_VncInfo2List(info2l);
qapi_free_VncInfo2List(info2l_head);
}
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册