summaryrefslogtreecommitdiff
path: root/src/lib/ecore_file/ecore_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ecore_file/ecore_file.c')
-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 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);