stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6fc6a9eebec30e4825c8749aa1bba27c43c168bb

commit 6fc6a9eebec30e4825c8749aa1bba27c43c168bb
Author: Stefan Schmidt <ste...@osg.samsung.com>
Date:   Mon Apr 18 14:26:02 2016 +0200

    elm_photo: make sure we have a separate variable for the sanitized path
    
    That way we can safely free it again after it got memory allocated from
    eina_file_path_sanitize(). Fixes a memory leak.
    
    CID: 1353601
---
 src/lib/elementary/elm_photo.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/elm_photo.c b/src/lib/elementary/elm_photo.c
index 803e07c..9752007 100644
--- a/src/lib/elementary/elm_photo.c
+++ b/src/lib/elementary/elm_photo.c
@@ -146,6 +146,7 @@ _long_press_cb(void *obj)
 {
    Evas_Object *img;
    const char *file;
+   char *sfile;
 
    ELM_PHOTO_DATA_GET(obj, sd);
 
@@ -161,8 +162,9 @@ _long_press_cb(void *obj)
      {
         char buf[4096 + 7];
 
-        file = eina_file_path_sanitize(file);
-        snprintf(buf, sizeof(buf), "file://%s", file);
+        sfile = eina_file_path_sanitize(file);
+        snprintf(buf, sizeof(buf), "file://%s", sfile);
+        free(sfile);
         if (elm_drag_start
               (obj, ELM_SEL_FORMAT_IMAGE, buf, ELM_XDND_ACTION_MOVE,
                   NULL, NULL,

-- 


Reply via email to