aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordx <aryadevchavali1@gmail.com>2020-05-06 06:19:10 +0100
committerdx <aryadevchavali1@gmail.com>2020-05-06 06:19:10 +0100
commitd9b756c5a552c6968791eac5f92cdfda91f696b4 (patch)
tree571306ff1cf346caced1adbdd321c2e10702da89
parentf84065859153a0331f80b8ce20bd3bb4c7656754 (diff)
downloadmdhtml-d9b756c5a552c6968791eac5f92cdfda91f696b4.tar.gz
mdhtml-d9b756c5a552c6968791eac5f92cdfda91f696b4.tar.bz2
mdhtml-d9b756c5a552c6968791eac5f92cdfda91f696b4.zip
~free memory in repl
-rw-r--r--Converter/src/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Converter/src/main.c b/Converter/src/main.c
index b60e80e..fbcd938 100644
--- a/Converter/src/main.c
+++ b/Converter/src/main.c
@@ -16,7 +16,9 @@ int main(int argc, char *argv[])
}
else
{
- puts(compile_line(argv[1], strnlen(argv[1], 1024), "<stdin>"));
+ string output = (compile_line(argv[1], strnlen(argv[1], 1024), "<stdin>"));
+ puts(output);
+ free(output);
}
}
@@ -27,7 +29,9 @@ int main(int argc, char *argv[])
printf("> ");
char *buf = malloc(sizeof(*buf) * 1024);
fgets(buf, 1024, stdin);
- puts(compile_line(buf, 1024, "<stdin>"));
+ string output = (compile_line(buf, 1024, "<stdin>"));
+ puts(output);
+ free(output);
}
}
}