>From 1199b756b8a5531dccdaa047c881df1db2440cde Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 27 Jun 2020 16:08:45 +0200 Subject: [PATCH] Fix a small memory leak. * poke/pk-repl.c (pk_repl): Free the line also when it is empty. --- poke/pk-repl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/poke/pk-repl.c b/poke/pk-repl.c index d0b3d7a..08505cb 100644 --- a/poke/pk-repl.c +++ b/poke/pk-repl.c @@ -329,14 +329,14 @@ pk_repl (void) } /* Ignore empty lines. */ - if (*line == '\0') - continue; - + if (*line != '\0') + { #if defined HAVE_READLINE_HISTORY_H - add_history (line); + add_history (line); #endif - pk_cmd_exec (line); + pk_cmd_exec (line); + } free (line); } #if defined HAVE_READLINE_HISTORY_H -- 2.7.4