stefan pushed a commit to branch elementary-1.7.
commit 3cecf760d9455678b532014a6cd18d8484d659fd
Author: Stefan Schmidt <[email protected]>
Date: Thu Jun 13 11:09:12 2013 +0100
elc_fileselector: Backport d713271bec8a24efdcfaa94191101e3c16108f0f
Cherry-pick failed so going with a manual backport.
elc_fileselector: Fix memory leak in _selected_set.
Using ecore_file_dir_get() like this will leak the returned string as we
have no way to control its free'ing. Better use a separate variable for it.
---
src/lib/elc_fileselector.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c
index 41bbdec..f5801b1 100644
--- a/src/lib/elc_fileselector.c
+++ b/src/lib/elc_fileselector.c
@@ -1156,6 +1156,7 @@ elm_fileselector_selected_set(Evas_Object *obj,
{
Eina_Bool ret = EINA_TRUE;
char *path;
+ char *selected;
ELM_FILESELECTOR_CHECK(obj) EINA_FALSE;
ELM_FILESELECTOR_DATA_GET(obj, sd);
@@ -1171,7 +1172,10 @@ elm_fileselector_selected_set(Evas_Object *obj,
goto clean_up;
}
- _populate(obj, ecore_file_dir_get(path), NULL);
+ selected = ecore_file_dir_get(path);
+ _populate(obj, selected, NULL);
+ free(selected);
+
if (sd->filename_entry)
{
char *s;
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev