From 0094e74a6d97f3c553afb0916579480f1e11d3d4 Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Wed, 2 Sep 2009 22:19:22 +0300 Subject: ephy-link-action.c: plug memory leak Noticed by Dan Winship. --- src/ephy-link-action.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ephy-link-action.c b/src/ephy-link-action.c index a5049c4ef..0447663ac 100644 --- a/src/ephy-link-action.c +++ b/src/ephy-link-action.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Copyright © 2004 Christian Persch * Copyright © 2005 Philip Langdale @@ -84,9 +85,13 @@ get_event_widget (GtkWidget *proxy) * The menu tool button's button is the first child * of the child hbox. */ - GtkContainer *container = - GTK_CONTAINER (gtk_bin_get_child (GTK_BIN (proxy))); - widget = GTK_WIDGET (gtk_container_get_children (container)->data); + GtkContainer *container; + GList *children; + + container = GTK_CONTAINER (gtk_bin_get_child (GTK_BIN (proxy))); + children = gtk_container_get_children (container); + widget = GTK_WIDGET (children->data); + g_list_free (children); } else if (GTK_IS_TOOL_BUTTON (proxy)) { -- cgit v1.2.3