Commit 2840d265 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

don't leak the return value of gtk_container_get_children (bug #305994,

2005-05-31  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpenumwidgets.c
	(gimp_enum_stock_box_set_child_padding): don't leak the return
	value of gtk_container_get_children (bug #305994, spotted by Ted
	Kremenek).

	* app/config/gimprc-serialize.c (gimp_rc_serialize_properties_diff):
	don't leak the GList in the unlikely case of an error (bug #305992,
	spotted by Ted Kremenek).
parent d9b5c44c
2005-05-31 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpenumwidgets.c
(gimp_enum_stock_box_set_child_padding): don't leak the return
value of gtk_container_get_children (bug #305994, spotted by Ted
Kremenek).
* app/config/gimprc-serialize.c (gimp_rc_serialize_properties_diff):
don't leak the GList in the unlikely case of an error (bug #305992,
spotted by Ted Kremenek).
2005-05-31 Sven Neumann <sven@gimp.org>
* app/core/gimppalette-import.c: applied patch from Joao
......
......@@ -67,6 +67,7 @@ gimp_rc_serialize_properties_diff (GimpConfig *config,
GObjectClass *klass;
GList *diff;
GList *list;
gboolean retval = TRUE;
g_return_val_if_fail (G_IS_OBJECT (config), FALSE);
g_return_val_if_fail (G_IS_OBJECT (compare), FALSE);
......@@ -78,9 +79,6 @@ gimp_rc_serialize_properties_diff (GimpConfig *config,
diff = gimp_config_diff (G_OBJECT (config),
G_OBJECT (compare), GIMP_CONFIG_PARAM_SERIALIZE);
if (! diff)
return TRUE;
for (list = diff; list; list = g_list_next (list))
{
GParamSpec *prop_spec = list->data;
......@@ -89,12 +87,15 @@ gimp_rc_serialize_properties_diff (GimpConfig *config,
continue;
if (! gimp_config_serialize_property (config, prop_spec, writer))
return FALSE;
{
retval = FALSE;
break;
}
}
g_list_free (diff);
return TRUE;
return retval;
}
static void
......
......@@ -404,13 +404,14 @@ gimp_enum_stock_box_set_child_padding (GtkWidget *stock_box,
gint xpad,
gint ypad)
{
GList *children;
GList *list;
g_return_if_fail (GTK_IS_CONTAINER (stock_box));
for (list = gtk_container_get_children (GTK_CONTAINER (stock_box));
list;
list = g_list_next (list))
children = gtk_container_get_children (GTK_CONTAINER (stock_box));
for (list = children; list; list = g_list_next (list))
{
GtkBin *bin = list->data;
......@@ -423,4 +424,6 @@ gimp_enum_stock_box_set_child_padding (GtkWidget *stock_box,
ypad < 0 ? misc->ypad : ypad);
}
}
g_list_free (children);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment