[gegl/soc-2012-ops] introspect.c: useless fix of a memory leak



commit 57f8199371e42b6df9b1e7cbc18319950105c8a3
Author: Michael Murà <batolettre gmail com>
Date:   Mon Jun 4 14:39:45 2012 +0900

    introspect.c: useless fix of a memory leak

 tools/introspect.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/tools/introspect.c b/tools/introspect.c
index 7e4eab3..55ffdd7 100644
--- a/tools/introspect.c
+++ b/tools/introspect.c
@@ -214,16 +214,18 @@ list_properties_simple (GType type)
        */
       if (!found)
         {
-
+          gchar *escaped;
           if (first)
             {
                fprintf (file, "<dl>");
                first = FALSE;
             }
+          escaped = escape (g_param_spec_get_blurb (self[prop_no]));
           fprintf (file, "<dt><b>%s</b> <em>%s</em></dt><dd>%s</dd>\n", 
               g_param_spec_get_name (self[prop_no]),
               g_type_name (G_OBJECT_TYPE(self[prop_no])),
-              escape (g_param_spec_get_blurb (self[prop_no])));
+              escaped);
+          g_free (escaped);
         }
     }
   if (!first)
@@ -270,16 +272,18 @@ list_properties (GType type,
        */
       if (!found)
         {
-
+          gchar *escaped;
           if (first)
             {
                fprintf (file, "<h5>Properties</h5><dl>");
                first = FALSE;
             }
+          escaped = escape (g_param_spec_get_blurb (self[prop_no]));
           fprintf (file, "<dt><b>%s</b> <em>%s</em></dt><dd>%s</dd>\n", 
               g_param_spec_get_name (self[prop_no]),
               g_type_name (G_OBJECT_TYPE(self[prop_no])),
-              escape(g_param_spec_get_blurb (self[prop_no])));
+              escaped);
+          g_free (escaped);
         }
     }
   if (!first)
@@ -299,15 +303,18 @@ list_properties (GType type,
        */
       if (found)
         {
+          gchar *escaped;
           if (first)
             {
                fprintf (file, "<h5>Inherited Properties</h5><dl>");
                first = FALSE;
             }
+          escaped = escape (g_param_spec_get_blurb (self[prop_no]));
           fprintf (file, "<dt><b>%s</b> <em>%s</em></dt><dd>%s</dd>\n", 
               g_param_spec_get_name (self[prop_no]),
               g_type_name (G_OBJECT_TYPE(self[prop_no])),
-              escape(g_param_spec_get_blurb (self[prop_no])));
+              escaped);
+          g_free (escaped);
         }
     }
   if (!first)



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