diff options
| -rw-r--r-- | py/lexerstr.c | 1 | ||||
| -rw-r--r-- | unix/main.c | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/py/lexerstr.c b/py/lexerstr.c index 8cbf36d83..1e105d864 100644 --- a/py/lexerstr.c +++ b/py/lexerstr.c @@ -25,6 +25,7 @@ static void str_buf_free(mp_lexer_str_buf_t *sb) { if (sb->free_len > 0) { m_free((char*)sb->src_beg, sb->free_len); } + m_del_obj(mp_lexer_str_buf_t, sb); } mp_lexer_t *mp_lexer_new_from_str_len(const char *src_name, const char *str, uint len, uint free_len) { diff --git a/unix/main.c b/unix/main.c index c93610670..681bf2aa2 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); } } |
