From 1660c787956968c6a2cc19919d16014ddcbdd4ed Mon Sep 17 00:00:00 2001 From: vsfos Date: Sat, 30 Sep 2023 02:41:00 +0800 Subject: [PATCH] unix/main: Fix memory leakage if MICROPY_USE_READLINE is disabled. --- ports/unix/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/unix/main.c b/ports/unix/main.c index b065706ba6..47973df8df 100644 --- a/ports/unix/main.c +++ b/ports/unix/main.c @@ -296,10 +296,10 @@ STATIC int do_repl(void) { } int ret = execute_from_lexer(LEX_SRC_STR, line, MP_PARSE_SINGLE_INPUT, true); + free(line); if (ret & FORCED_EXIT) { return ret; } - free(line); } #endif