Commit 7618be62 authored by Stefan Weil's avatar Stefan Weil Committed by Luiz Capitulino
Browse files

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: default avatarStefan Weil <sw@weilnetz.de>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
parent ad608da5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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 */