[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/8] monitor: Fix memory leak with readline completi
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 4/8] monitor: Fix memory leak with readline completion |
Date: |
Fri, 15 Jun 2012 14:10:01 -0300 |
From: Stefan Weil <address@hidden>
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 <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
---
readline.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/readline.c b/readline.c
index a6c0039..540cd8a 100644
--- a/readline.c
+++ b/readline.c
@@ -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 */
--
1.7.10.2.565.gbd578b5
- [Qemu-devel] [PULL 0/8]: QMP queue, Luiz Capitulino, 2012/06/15
- [Qemu-devel] [PATCH 1/8] kvm: add missing include files, Luiz Capitulino, 2012/06/15
- [Qemu-devel] [PATCH 3/8] qmp: do not include monitor.h from qapi-types-core.h, Luiz Capitulino, 2012/06/15
- [Qemu-devel] [PATCH 2/8] qmp: include monitor.h when needed, Luiz Capitulino, 2012/06/15
- [Qemu-devel] [PATCH 4/8] monitor: Fix memory leak with readline completion,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 6/8] Add event notification for guest balloon changes, Luiz Capitulino, 2012/06/15
- [Qemu-devel] [PATCH 5/8] Fix some more license versions (GPL2+ instead of GPL2), Luiz Capitulino, 2012/06/15
- [Qemu-devel] [PATCH 8/8] build: install qmp-commands.txt, Luiz Capitulino, 2012/06/15
- [Qemu-devel] [PATCH 7/8] Add rate limiting of RTC_CHANGE, BALLOON_CHANGE & WATCHDOG events, Luiz Capitulino, 2012/06/15
- Re: [Qemu-devel] [PULL 0/8]: QMP queue, Anthony Liguori, 2012/06/20