summaryrefslogtreecommitdiff
path: root/src/bin/exactness/recorder.c
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2020-02-25 11:42:17 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2020-02-26 15:15:45 +0100
commitde389fbe5e5f4f46808dabd92ca291e1a41077cd (patch)
tree85d3327f8ab017263eca7a751f51757decb3ed0d /src/bin/exactness/recorder.c
parentfa0fd8214f9db72413738686b81bb8a0576528c2 (diff)
exactness: avoid leak on leaving scope
Before we leave the fucntion here we need to free our temporaray paths variable. CID: 1419860 Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D11411
Diffstat (limited to '')
-rw-r--r--src/bin/exactness/recorder.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/exactness/recorder.c b/src/bin/exactness/recorder.c
index 5b529b5b8c..c3f1ced58b 100644
--- a/src/bin/exactness/recorder.c
+++ b/src/bin/exactness/recorder.c
@@ -305,8 +305,10 @@ _prg_full_path_guess(const char *prg)
305{ 305{
306 char full_path[MAX_PATH]; 306 char full_path[MAX_PATH];
307 if (strchr(prg, '/')) return eina_stringshare_add(prg); 307 if (strchr(prg, '/')) return eina_stringshare_add(prg);
308 char *paths = strdup(getenv("PATH")); 308 char *env_path = strdup(getenv("PATH"));
309 Eina_Stringshare *ret = NULL; 309 Eina_Stringshare *ret = NULL;
310 char *paths = env_path;
311
310 while (paths && *paths && !ret) 312 while (paths && *paths && !ret)
311 { 313 {
312 char *real_path; 314 char *real_path;
@@ -325,6 +327,7 @@ _prg_full_path_guess(const char *prg)
325 paths += strlen(paths); 327 paths += strlen(paths);
326 if (colon) paths++; 328 if (colon) paths++;
327 } 329 }
330 free(env_path);
328 return ret; 331 return ret;
329} 332}
330 333