From 97c79ae01a7bd761789259842e7d38e2cc723048 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 15 Sep 2022 22:47:57 -0400 Subject: free resources in find_program --- mstat_plot.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mstat_plot.c') 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; } -- cgit