aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-07-09 15:42:09 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-07-09 15:42:09 +0200
commita833f7029616579ecf0457ca98f5705b8f915fe0 (patch)
tree7023158e05fe758ac6669251992e08878db58e7c
parent72c344521267378fd82e675a7c2f40a9ae25287e (diff)
downloadbuild-a833f7029616579ecf0457ca98f5705b8f915fe0.tar.gz
Fix use after free
-rw-r--r--build.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/build.c b/build.c
index 085722d..912dc97 100644
--- a/build.c
+++ b/build.c
@@ -152,12 +152,13 @@ main(int argc, char *argv[])
"exist\n", argv[0], d);
continue;
}
- free(d);
if (sb.st_mtime > ssb.st_mtime) {
d("%s: %s is modified, building\n",
argv[i], d);
+ free(d);
goto build;
}
+ free(d);
}
uptodate: