fileselector: Simple refactoring to fix possible leak.

This fixes "Resource leaks" which was spotted by coverity. CID 1054518
This commit is contained in:
Ryuan Choi 2013-08-06 20:08:16 +09:00
parent 5c49ccfb24
commit 5cfb0d9b7c
1 changed files with 5 additions and 5 deletions

View File

@ -667,21 +667,21 @@ _on_item_selected(void *data,
if (!path)
return;
sdata = malloc(sizeof(*sdata));
sdata->fs = data;
sdata->path = path;
if (sd->only_folder)
eina_stringshare_replace(&sd->path, path);
else
{
dir = ecore_file_dir_get(sdata->path);
dir = ecore_file_dir_get(path);
if (!dir) return;
eina_stringshare_replace(&sd->path, dir);
free(dir);
}
sdata = malloc(sizeof(*sdata));
sdata->fs = data;
sdata->path = path;
if (sd->sel_idler)
{
old_sd = ecore_idler_del(sd->sel_idler);