Commit 2b2cb7b7 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

unix main: Free input line.

Also, readline uses system malloc, so for symmetry, use the same for
non-readline case.
parent 39763c6c
......@@ -112,7 +112,7 @@ static char *prompt(char *p) {
} else {
l++;
}
char *line = m_new(char, l);
char *line = malloc(l);
memcpy(line, buf, l);
#endif
return line;
......@@ -140,6 +140,7 @@ static void do_repl(void) {
mp_lexer_t *lex = mp_lexer_new_from_str_len("<stdin>", line, strlen(line), false);
execute_from_lexer(lex, MP_PARSE_SINGLE_INPUT, true);
free(line);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment