unix main: Free input line.

Also, readline uses system malloc, so for symmetry, use the same for
non-readline case.
pull/217/head
Paul Sokolovsky 2014-01-24 16:21:26 +02:00
rodzic 39763c6cb0
commit 2b2cb7b7f4
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -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);
}
}