unix/main: Fix memory leakage if MICROPY_USE_READLINE is disabled.

This commit is contained in:
vsfos
2023-09-30 02:41:00 +08:00
committed by Damien George
parent 4e5611c55a
commit 1660c78795

View File

@@ -296,10 +296,10 @@ STATIC int do_repl(void) {
} }
int ret = execute_from_lexer(LEX_SRC_STR, line, MP_PARSE_SINGLE_INPUT, true); int ret = execute_from_lexer(LEX_SRC_STR, line, MP_PARSE_SINGLE_INPUT, true);
free(line);
if (ret & FORCED_EXIT) { if (ret & FORCED_EXIT) {
return ret; return ret;
} }
free(line);
} }
#endif #endif