summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-01-14 11:53:31 -0500
committerJakob Kaivo <jkk@ung.org>2020-01-14 11:53:31 -0500
commita1fabe91eb33ef17030c588dfbdfd9d781a7ea63 (patch)
tree6ce36a86f95d9a9709f34a08b8b61bb2ca0de4d9
parentce7f2c194888d91e52e05cb8acff45032ca122ad (diff)
clean up memory leak
-rw-r--r--make.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/make.c b/make.c
index 683410f..919cac8 100644
--- a/make.c
+++ b/make.c
@@ -2,6 +2,7 @@
#include <libgen.h>
#include <string.h>
#include <stdio.h>
+#include <stdlib.h>
#include "maje.h"
@@ -32,6 +33,8 @@ static void addfile(FILE *makefile, const char *src, const char *target)
fprintf(makefile, "%s: %s\n", target, obj);
fprintf(makefile, "%s: %s\n", obj, src);
fprintf(makefile, "\t$(CC) $(CFLAGS) -c %s\n\n", src);
+
+ free(obj);
}
void make_makefile(const char *makepath, char **sources, const char *target)