forked from enlightenment/efl
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:
parent
6b7172d6e3
commit
6fc6a9eebe
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue