[gtk+/composite-templates] Plug a small memory leak



commit 31837045a3865d1e4481b4125640113314908dec
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Sep 13 00:14:16 2012 -0400

    Plug a small memory leak

 gtk/deprecated/gtkstyle.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gtk/deprecated/gtkstyle.c b/gtk/deprecated/gtkstyle.c
index d6ea17e..c981aaa 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]