]> Pileus Git - ~andy/gtk/commitdiff
Plug a small memory leak
authorMatthias Clasen <mclasen@redhat.com>
Thu, 13 Sep 2012 04:14:16 +0000 (00:14 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 13 Sep 2012 04:14:16 +0000 (00:14 -0400)
gtk/deprecated/gtkstyle.c

index d6ea17e80a48ec5fbdbbe35513449e67e7055d87..c981aaa8dd7e20cac94f5950ad3c12863bfafef3 100644 (file)
@@ -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);