From ba2e43111e7fccf9c13d20a4eed3d6dc1ab50d54 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 13 Sep 2012 00:14:16 -0400 Subject: [PATCH] Plug a small memory leak --- gtk/deprecated/gtkstyle.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gtk/deprecated/gtkstyle.c b/gtk/deprecated/gtkstyle.c index d6ea17e80..c981aaa8d 100644 --- a/gtk/deprecated/gtkstyle.c +++ b/gtk/deprecated/gtkstyle.c @@ -655,9 +655,15 @@ set_color_from_context (GtkStyle *style, break; } - if (!color || !(color->alpha > 0.01)) + if (!color) return FALSE; + if (!(color->alpha > 0.01)) + { + gdk_rgba_free (color); + return FALSE; + } + dest->pixel = 0; dest->red = CLAMP ((guint) (color->red * 65535), 0, 65535); dest->green = CLAMP ((guint) (color->green * 65535), 0, 65535); -- 2.43.2