From 7198dd059631c764df6018e2aa7c47e56a384135 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 29 Sep 2017 18:12:59 +0200 Subject: GUI: Fix memory leak with empty debugger input --- gui/debugger.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gui') diff --git a/gui/debugger.cpp b/gui/debugger.cpp index b18e50b824..ce4661e9cb 100644 --- a/gui/debugger.cpp +++ b/gui/debugger.cpp @@ -297,8 +297,10 @@ bool Debugger::parseCommand(const char *inputOrig) { char *input = strdup(inputOrig); splitCommand(input, num_params, ¶m[0]); - if (num_params == 0) + if (num_params == 0) { + free(input); return true; + } // Handle commands first bool result; -- cgit v1.2.3