monitor: Fix memory leak with readline completion
PATCH 1/1 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.
--- readline.c | 3 +++ 1 file changed, 3 insertions(+)
readline.c +3 -0
@@ -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 */
Signature · 1 line
1.7.10
Am 14.05.2012 21:47, schrieb Stefan Weil:
Quoted 16 lines
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_freefor the allocated strings.Signed-off-by Stefan Weil<[email protected]>--- readline.c | 3 +++ 1 file changed, 3 insertions(+)readline.c +0
-0
readline.c static void readline_completion(ReadLineState *rs) · line 345
Quoted 9 lines
readline.c +3
-0@@ -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 */
Ping?
This patch is for QEMU 1.1, but was not committed up to now.
Regards,
Stefan Weil
Am 22.05.2012 22:24, schrieb Stefan Weil:
Quoted 24 lines
Am 14.05.2012 21:47, schrieb Stefan Weil:
Quoted 23 lines
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_freefor the allocated strings.Signed-off-by Stefan Weil<[email protected]>--- readline.c | 3 +++ 1 file changed, 3 insertions(+)readline.c +3
-0@@ -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]); + } }
Quoted 9 lines
readline.c static void readline_completion(ReadLineState *rs) · line 345
Quoted 1 line
readline.c +0
-0/* return true if command handled */ Ping?
This patch is for QEMU 1.1, but was not committed up to now.
Regards,
Stefan Weil
Ping^2? Should I send a pull request?
The patch is available at http://patchwork.ozlabs.org/patch/159139/.
Regards,
Stefan Weil
Luiz Capitulino
AppliedQuoted 32 lines · On Sat, 09 Jun 2012 23:36:26 +0200 Stefan Weil <[email protected]> wrote:
Am 22.05.2012 22:24, schrieb Stefan Weil:
Quoted 31 lines
Am 14.05.2012 21:47, schrieb Stefan Weil:
Quoted 16 lines
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_freefor the allocated strings.Signed-off-by Stefan Weil<[email protected]>--- readline.c | 3 +++ 1 file changed, 3 insertions(+)readline.c +0
-0readline.c static void readline_completion(ReadLineState *rs) · line 345
Quoted 9 lines
readline.c +3
-0@@ -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 */ Ping?
This patch is for QEMU 1.1, but was not committed up to now.
Quoted 7 lines
Quoted 3 lines
Regards,
Stefan WeilPing^2? Should I send a pull request?
The patch is available at http://patchwork.ozlabs.org/patch/159139/.
Applied to the qmp branch, thanks.
Quoted 9 lines · Stefan Weil
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_freefor the allocated strings.Signed-off-by Stefan Weil <[email protected]>---
readline.c | 3 +++1 file changed, 3 insertions(+)