file_browser: Set NULL to freed data pointer to prevent double free.

To prevent double free when genlist items are expanded and contracted,
set NULL to freed data pointer.
This commit is contained in:
Jaehyun Cho 2016-05-14 19:57:17 +09:00
parent 2b40c0a170
commit 5268e282d5
1 changed files with 19 additions and 4 deletions

View File

@ -375,13 +375,28 @@ brows_file_free(brows_file *file)
{
if (!file) return;
if (file->path) free(file->path);
if (file->name) free(file->name);
if (file->path)
{
free(file->path);
file->path = NULL;
}
if (file->name)
{
free(file->name);
file->name = NULL;
}
if (file->sub_file_list)
brows_file_list_free(file->sub_file_list);
{
brows_file_list_free(file->sub_file_list);
file->sub_file_list = NULL;
}
if (file->it) elm_object_item_del(file->it);
if (file->it)
{
elm_object_item_del(file->it);
file->it = NULL;
}
}
static void