summaryrefslogtreecommitdiff
path: root/ports/unix/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/unix/main.c')
-rw-r--r--ports/unix/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ports/unix/main.c b/ports/unix/main.c
index 7920db02f..d6ae1e611 100644
--- a/ports/unix/main.c
+++ b/ports/unix/main.c
@@ -699,6 +699,7 @@ MP_NOINLINE int main_(int argc, char **argv) {
char *basedir = realpath(argv[a], pathbuf);
if (basedir == NULL) {
mp_printf(&mp_stderr_print, "%s: can't open file '%s': [Errno %d] %s\n", argv[0], argv[a], errno, strerror(errno));
+ free(pathbuf);
// CPython exits with 2 in such case
ret = 2;
break;