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
This commit is contained in:
Stefan Schmidt 2016-04-18 14:26:02 +02:00
parent 6b7172d6e3
commit 6fc6a9eebe
1 changed files with 4 additions and 2 deletions

View File

@ -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,