diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-01-24 16:21:26 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-01-24 16:29:49 +0200 |
commit | 2b2cb7b7f4f467b67082f79053118df78f48e66e (patch) | |
tree | 64e5947367f4abe521a7f04eb876df40381ccec0 /unix/main.c | |
parent | 39763c6cb00a3f48bb1145e8869e778ba48190da (diff) | |
download | micropython-2b2cb7b7f4f467b67082f79053118df78f48e66e.tar.gz micropython-2b2cb7b7f4f467b67082f79053118df78f48e66e.zip |
unix main: Free input line.
Also, readline uses system malloc, so for symmetry, use the same for
non-readline case.
Diffstat (limited to 'unix/main.c')
-rw-r--r-- | unix/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/unix/main.c b/unix/main.c index c936106706..681bf2aa20 100644 --- a/unix/main.c +++ b/unix/main.c @@ -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); } } |