mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
monitor: Fix memory leak with readline completion
Each string which is shown during readline completion in the QEMU monitor is allocated dynamically but currently never deallocated. Add the missing loop which calls g_free for the allocated strings. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
This commit is contained in:
parent
7677e24f3d
commit
fc9fa4bd0a
1 changed files with 3 additions and 0 deletions
|
@ -337,6 +337,9 @@ static void readline_completion(ReadLineState *rs)
|
|||
}
|
||||
readline_show_prompt(rs);
|
||||
}
|
||||
for (i = 0; i < rs->nb_completions; i++) {
|
||||
g_free(rs->completions[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/* return true if command handled */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue