aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2016-01-27 22:14:16 +0100
committerCamil Staps2016-01-27 22:14:16 +0100
commitd0cfd19aca595c0aa7f71edaf7185a5385eb6ec0 (patch)
tree003b5ef7754a636d8ece30f490cf35f4674e3ab4
parentreadline history (diff)
parentfree up memory after allocation to avoid memory leak (diff)
Merge pull request #1 from dopefishh/master
Free up memory after allocation to avoid memory leak.
-rw-r--r--compile.c4
1 files changed, 4 insertions, 0 deletions
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) {
// <module> -nt
strcat(execchars, " -nt");
system(execchars);
+ free(execchars);
}