aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2022-09-15 22:47:57 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2022-09-15 22:47:57 -0400
commit97c79ae01a7bd761789259842e7d38e2cc723048 (patch)
treeb70265ea625227eceed8df93e509fd345fb72394
parent9478a7562e2780b4f9522c80f579153566308214 (diff)
downloadmstat-97c79ae01a7bd761789259842e7d38e2cc723048.tar.gz
free resources in find_program
-rw-r--r--mstat_plot.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mstat_plot.c b/mstat_plot.c
index e846c61..b71ef69 100644
--- a/mstat_plot.c
+++ b/mstat_plot.c
@@ -49,9 +49,11 @@ static int find_program(const char *name) {
while ((token = strsep(&path, ":")) != NULL) {
snprintf(pathtest, PATH_MAX - 1, "%s/%s", token, name);
if (access(pathtest, F_OK | X_OK) == 0) {
+ free(path);
return 0;
}
}
+ free(path);
return 1;
}