[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 4/9] hmp/vnc: Fix info vnc list leak
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 4/9] hmp/vnc: Fix info vnc list leak |
Date: |
Wed, 25 Mar 2020 13:16:27 +0000 |
From: "Dr. David Alan Gilbert" <address@hidden>
We're iterating the list, and then freeing the iteration pointer rather
than the list head.
Fixes: 0a9667ecdb6d ("hmp: Update info vnc")
Reported-by: Coverity (CID 1421932)
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
monitor/hmp-cmds.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 76725c2ace..04ca342c51 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -527,10 +527,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;
@@ -559,7 +560,7 @@ void hmp_info_vnc(Monitor *mon, const QDict *qdict)
info2l = info2l->next;
}
- qapi_free_VncInfo2List(info2l);
+ qapi_free_VncInfo2List(info2l_head);
}
#endif
--
2.25.1
- [PULL 0/9] migration queue, Dr. David Alan Gilbert (git), 2020/03/25
- [PULL 2/9] xbzrle: update xbzrle doc, Dr. David Alan Gilbert (git), 2020/03/25
- [PULL 1/9] hmp-cmd: fix a missing_break warning, Dr. David Alan Gilbert (git), 2020/03/25
- [PULL 3/9] tests/migration: Reduce autoconverge initial bandwidth, Dr. David Alan Gilbert (git), 2020/03/25
- [PULL 4/9] hmp/vnc: Fix info vnc list leak,
Dr. David Alan Gilbert (git) <=
- [PULL 5/9] tools/virtiofsd/passthrough_ll: Fix double close(), Dr. David Alan Gilbert (git), 2020/03/25
- [PULL 6/9] vl.c: fix migration failure for 3.1 and older machine types, Dr. David Alan Gilbert (git), 2020/03/25
- [PULL 7/9] migration/colo: fix use after free of local_err, Dr. David Alan Gilbert (git), 2020/03/25
- [PULL 9/9] migration: use "" instead of (null) for tls-authz, Dr. David Alan Gilbert (git), 2020/03/25
- [PULL 8/9] migration/ram: fix use after free of local_err, Dr. David Alan Gilbert (git), 2020/03/25
- Re: [PULL 0/9] migration queue, Peter Maydell, 2020/03/26