diff --git a/unix/main.c b/unix/main.c
index c93610670656d3da543a98062bef695f5e429f1f..681bf2aa20fc506907d1bea5fd21c8458b46c6ce 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);
     }
 }