[glib] GVariant: fix two small/theoretical leaks



commit 662e3c4891a63498d9720d7c9a3d782f30374d3a
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Jul 11 12:26:33 2013 -0400

    GVariant: fix two small/theoretical leaks
    
    Fix some leaks that turned up while valgrinding the GVariant testcase.
    
    These leaks are small and only occur when there is already an error in
    the program: they are leaks of temp strings used when formatting a
    critical message.
    
    These show up as leaks again the testcase under the new "expect
    messages" approach.  Previously, we fork()ed and these caused the
    subprocess to abort, which is why this was not noticed before.

 glib/gvariant.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/glib/gvariant.c b/glib/gvariant.c
index 2197cb0..3b3f7df 100644
--- a/glib/gvariant.c
+++ b/glib/gvariant.c
@@ -4006,6 +4006,8 @@ valid_format_string (const gchar *format_string,
                   fragment, typestr, g_variant_get_type_string (value));
 
       g_variant_type_free (type);
+      g_free (fragment);
+      g_free (typestr);
 
       return FALSE;
     }


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