stefan pushed a commit to branch master.
commit d713271bec8a24efdcfaa94191101e3c16108f0f
Author: Stefan Schmidt <[email protected]>
Date: Mon Jun 10 15:47:54 2013 +0100
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 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c
index 4a7d001..863e4e7 100644
--- a/src/lib/elc_fileselector.c
+++ b/src/lib/elc_fileselector.c
@@ -1236,6 +1236,7 @@ _selected_set(Eo *obj, void *_pd, va_list *list)
{
const char *_path = va_arg(*list, const char *);
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ char *selected;
if (ret) *ret = EINA_TRUE;
char *path;
@@ -1253,8 +1254,10 @@ _selected_set(Eo *obj, void *_pd, va_list *list)
goto clean_up;
}
- _populate(obj, ecore_file_dir_get(path), NULL);
- eina_stringshare_replace(&sd->selection, path);
+ selected= ecore_file_dir_get(path);
+ _populate(obj, selected, NULL);
+ eina_stringshare_replace(&sd->selection, path);
+ free(selected);
}
clean_up:
--
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j