summaryrefslogtreecommitdiff
path: root/src/lib/ecore_file
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-13 21:23:07 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-13 21:26:05 +0900
commitf8b5dcf126664a8b3c2cea03420e7bbd2a0c569a (patch)
tree3c47af0ad6e2de6c83de84b7bbc76dbe2292476f /src/lib/ecore_file
parente4b029da0b237745314d5d28609f3f81d479215f (diff)
ecore_file - finding exe path - if HOME is not set a leak could happen
this fixes CID 1039279
Diffstat (limited to 'src/lib/ecore_file')
-rw-r--r--src/lib/ecore_file/ecore_file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/ecore_file/ecore_file.c b/src/lib/ecore_file/ecore_file.c
index 634709f048..efca2c8d83 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)
857EAPI char * 857EAPI char *
858ecore_file_app_exe_get(const char *app) 858ecore_file_app_exe_get(const char *app)
859{ 859{
860 char *p, *pp, *exe1 = NULL, *exe2 = NULL; 860 char *p, *pp = NULL, *exe1 = NULL, *exe2 = NULL;
861 char *exe = NULL; 861 char *exe = NULL;
862 int in_quot_dbl = 0, in_quot_sing = 0, restart = 0; 862 int in_quot_dbl = 0, in_quot_sing = 0, restart = 0;
863 863
@@ -901,7 +901,11 @@ restart:
901 exe1++; 901 exe1++;
902 902
903 homedir = getenv("HOME"); 903 homedir = getenv("HOME");
904 if (!homedir) return NULL; 904 if (!homedir)
905 {
906 if (pp) free(pp);
907 return NULL;
908 }
905 len = strlen(homedir); 909 len = strlen(homedir);
906 if (exe) free(exe); 910 if (exe) free(exe);
907 exe = malloc(len + exe2 - exe1 + 2); 911 exe = malloc(len + exe2 - exe1 + 2);