From f8b5dcf126664a8b3c2cea03420e7bbd2a0c569a Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 13 Dec 2013 21:23:07 +0900 Subject: ecore_file - finding exe path - if HOME is not set a leak could happen this fixes CID 1039279 --- src/lib/ecore_file/ecore_file.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore_file/ecore_file.c b/src/lib/ecore_file/ecore_file.c index 634709f04..efca2c8d8 100644 --- a/src/lib/ecore_file/ecore_file.c +++ b/src/lib/ecore_file/ecore_file.c @@ -857,7 +857,7 @@ ecore_file_ls(const char *dir) EAPI char * ecore_file_app_exe_get(const char *app) { - char *p, *pp, *exe1 = NULL, *exe2 = NULL; + char *p, *pp = NULL, *exe1 = NULL, *exe2 = NULL; char *exe = NULL; int in_quot_dbl = 0, in_quot_sing = 0, restart = 0; @@ -901,7 +901,11 @@ restart: exe1++; homedir = getenv("HOME"); - if (!homedir) return NULL; + if (!homedir) + { + if (pp) free(pp); + return NULL; + } len = strlen(homedir); if (exe) free(exe); exe = malloc(len + exe2 - exe1 + 2); -- cgit v1.2.3