From 88ff21ee92237858b65560d20f255506f2125a55 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 21 Apr 2010 18:08:05 -0400 Subject: [PATCH] Be more careful about memory management This was leading to crashes, e.g. bug 616432. --- gio/gschema-compile.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gio/gschema-compile.c b/gio/gschema-compile.c index 9877ad8..359d721 100644 --- a/gio/gschema-compile.c +++ b/gio/gschema-compile.c @@ -370,9 +370,6 @@ end_element (GMarkupParseContext *context, state->value = g_variant_parse (state->type, state->string->str, NULL, NULL, error); - if (state->value == NULL) - return; - if (state->l10n) { if (state->context) @@ -398,7 +395,9 @@ end_element (GMarkupParseContext *context, } g_string_free (state->string, TRUE); + state->string = NULL; g_free (state->context); + state->context = NULL; } else if (strcmp (element_name, "key") == 0) @@ -418,7 +417,10 @@ end_element (GMarkupParseContext *context, else if (strcmp (element_name, "summary") == 0 || strcmp (element_name, "description") == 0) - g_string_free (state->string, TRUE); + { + g_string_free (state->string, TRUE); + state->string = NULL; + } } static void -- 2.7.4