forked from enlightenment/efl
fileselector: Simple refactoring to fix possible leak.
This fixes "Resource leaks" which was spotted by coverity. CID 1054518
This commit is contained in:
parent
5c49ccfb24
commit
5cfb0d9b7c
|
@ -667,21 +667,21 @@ _on_item_selected(void *data,
|
||||||
if (!path)
|
if (!path)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sdata = malloc(sizeof(*sdata));
|
|
||||||
sdata->fs = data;
|
|
||||||
sdata->path = path;
|
|
||||||
|
|
||||||
if (sd->only_folder)
|
if (sd->only_folder)
|
||||||
eina_stringshare_replace(&sd->path, path);
|
eina_stringshare_replace(&sd->path, path);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dir = ecore_file_dir_get(sdata->path);
|
dir = ecore_file_dir_get(path);
|
||||||
if (!dir) return;
|
if (!dir) return;
|
||||||
|
|
||||||
eina_stringshare_replace(&sd->path, dir);
|
eina_stringshare_replace(&sd->path, dir);
|
||||||
free(dir);
|
free(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sdata = malloc(sizeof(*sdata));
|
||||||
|
sdata->fs = data;
|
||||||
|
sdata->path = path;
|
||||||
|
|
||||||
if (sd->sel_idler)
|
if (sd->sel_idler)
|
||||||
{
|
{
|
||||||
old_sd = ecore_idler_del(sd->sel_idler);
|
old_sd = ecore_idler_del(sd->sel_idler);
|
||||||
|
|
Loading…
Reference in New Issue