diff options
author | Stefan Weil <sw@weilnetz.de> | 2012-05-14 21:47:20 +0200 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2012-06-15 10:41:05 -0300 |
commit | 7618be6230efebab643513eb92fd93c79da36e4d (patch) | |
tree | 6c558618a1c5f632d91837a7e1d1b72db2c1e133 | |
parent | ad608da51d59aed20905138bc4cc524bc77f42de (diff) | |
download | qemu-7618be6230efebab643513eb92fd93c79da36e4d.zip qemu-7618be6230efebab643513eb92fd93c79da36e4d.tar.gz qemu-7618be6230efebab643513eb92fd93c79da36e4d.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>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.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 */ |