diff options
author | Stefan Weil <sw@weilnetz.de> | 2012-05-14 09:47:20 +0000 |
---|---|---|
committer | Stefan Weil <sw@weilnetz.de> | 2012-06-11 22:20:00 +0200 |
commit | fc9fa4bd0a295ac18808c4cd2cfac484bc4649d3 (patch) | |
tree | 6bacdd9d7b6ea72758bfcd541880c7b9c84245d7 | |
parent | 7677e24f3db8466c7d6014a794b1e425bc7929ba (diff) | |
download | qemu-fc9fa4bd0a295ac18808c4cd2cfac484bc4649d3.zip qemu-fc9fa4bd0a295ac18808c4cd2cfac484bc4649d3.tar.gz qemu-fc9fa4bd0a295ac18808c4cd2cfac484bc4649d3.tar.bz2 |
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>
-rw-r--r-- | readline.c | 3 |
1 files changed, 3 insertions, 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 */ |