diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2022-09-15 22:47:57 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2022-09-15 22:47:57 -0400 |
commit | 97c79ae01a7bd761789259842e7d38e2cc723048 (patch) | |
tree | b70265ea625227eceed8df93e509fd345fb72394 /mstat_plot.c | |
parent | 9478a7562e2780b4f9522c80f579153566308214 (diff) | |
download | mstat-97c79ae01a7bd761789259842e7d38e2cc723048.tar.gz |
free resources in find_program
Diffstat (limited to 'mstat_plot.c')
-rw-r--r-- | mstat_plot.c | 2 |
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; } |