app: fix 2 possible leaks.

In some cases, the `src_viewables` and `drop_path` variables may leak.
Thanks to Massimo for the report on `src_viewables`!
This commit is contained in:
Jehan 2021-08-14 19:57:00 +02:00
parent b1afc33971
commit a10bb056ed
1 changed files with 6 additions and 3 deletions

View File

@ -225,7 +225,6 @@ gimp_container_tree_view_drop_status (GimpContainerTreeView *tree_view,
{
g_warning ("%s: contents of the viewable list has the wrong type '%s'.",
G_STRFUNC, G_OBJECT_TYPE_NAME (iter->data));
g_list_free (src_viewables);
goto drop_impossible;
}
}
@ -336,6 +335,10 @@ gimp_container_tree_view_drop_status (GimpContainerTreeView *tree_view,
tree_view);
*return_src = src_viewables;
}
else
{
g_list_free (src_viewables);
}
if (return_dest)
*return_dest = dest_viewable;
@ -345,12 +348,12 @@ gimp_container_tree_view_drop_status (GimpContainerTreeView *tree_view,
return TRUE;
}
gtk_tree_path_free (drop_path);
}
drop_impossible:
g_list_free (src_viewables);
gtk_tree_path_free (drop_path);
gdk_drag_status (context, 0, time);
return FALSE;