[glade/gbinding: 16/60] Fix memory leak (thanks Juan!)



commit f4833ce42622ad5179d2135869d6308f82b5b129
Author: Denis Washington <denisw src gnome org>
Date:   Fri Jun 10 13:57:25 2011 +0200

    Fix memory leak (thanks Juan!)

 gladeui/glade-binding.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gladeui/glade-binding.c b/gladeui/glade-binding.c
index 08f4858..6416df3 100644
--- a/gladeui/glade-binding.c
+++ b/gladeui/glade-binding.c
@@ -276,7 +276,15 @@ glade_binding_read (GladeXmlNode *node,
   source = glade_xml_get_property_string_required (node, GLADE_XML_TAG_SOURCE, NULL);
   
   if (!to || !from || !source)
-    return NULL;
+    {
+      if (to)
+        g_free (to);
+      if (from)
+        g_free (from);
+      if (source)
+        g_free (source);
+      return NULL;
+    }
 
   target = glade_widget_get_property (widget, to);
   binding = glade_binding_new (NULL, target);



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