From 0bc4354f1fc7e3cf6fc981aa5cb2c71bbc23ecbc Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Wed, 27 Jan 2016 22:11:45 +0100 Subject: free up memory after allocation to avoid memory leak --- compile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compile.c b/compile.c index 71d6f11..d0a3ee0 100644 --- a/compile.c +++ b/compile.c @@ -75,6 +75,9 @@ int64_t compile(CleanString path, CleanString module) { strcat(cmd, " -o "); strcat(cmd, modulechars); + free(pathchars); + free(modulechars); + // Call clm return system(cmd); } @@ -111,5 +114,6 @@ void run(CleanString executable) { // -nt strcat(execchars, " -nt"); system(execchars); + free(execchars); } -- cgit v1.2.3