[glade/tintou/dnd-tiny-leak] gladeui: Plug tiny leak on Drag & Drop
- From: Corentin Noël <corentinnoel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/tintou/dnd-tiny-leak] gladeui: Plug tiny leak on Drag & Drop
- Date: Tue, 10 Sep 2019 14:22:24 +0000 (UTC)
commit 4219ca120da77c0d9548483e5e1b62c4bdcbc85e
Author: Corentin Noël <corentin noel collabora com>
Date: Tue Sep 10 16:21:26 2019 +0200
gladeui: Plug tiny leak on Drag & Drop
gladeui/glade-dnd.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gladeui/glade-dnd.c b/gladeui/glade-dnd.c
index fae793a5..4a94fc22 100644
--- a/gladeui/glade-dnd.c
+++ b/gladeui/glade-dnd.c
@@ -44,9 +44,12 @@ _glade_dnd_get_data (GdkDragContext *context,
guint info)
{
GdkAtom target = gtk_selection_data_get_target (selection);
+ gchar *target_name = gdk_atom_name (target);
+ gboolean is_target_data = (g_strcmp0 (target_name, GLADE_DND_TARGET_DATA) == 0);
- if (info == GLADE_DND_INFO_DATA &&
- g_strcmp0 (gdk_atom_name (target), GLADE_DND_TARGET_DATA) == 0)
+ g_free (target_name);
+
+ if (info == GLADE_DND_INFO_DATA && is_target_data)
{
const guchar *data = gtk_selection_data_get_data (selection);
if (data)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]