From ea458a10885ec5c452e3460a582108bf19eaf77e Mon Sep 17 00:00:00 2001 From: Jon Feldman Date: Wed, 26 Jul 2017 09:49:20 -0400 Subject: [PATCH] shell: clean up memory --- gsh_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gsh_main.c b/gsh_main.c index 58e0fe6..715cbe9 100644 --- a/gsh_main.c +++ b/gsh_main.c @@ -484,6 +484,8 @@ int main(int argc, char **argv) { ast_t *toks = parse(run_str); toks = resolve(toks); execute(toks, NULL); + free(toks->ptr); + free(toks); } else { while (!shell_do_exit) { // Read a command in. @@ -491,6 +493,8 @@ int main(int argc, char **argv) { ast_t *toks = parse(input); toks = resolve(toks); execute(toks, NULL); + free(toks->ptr); + free(toks); // FIXME: free the damn toks memory, this requires traversing to the bottom tho free(input); } -- 2.39.5