[json-glib] builder: Initialize state fields



commit d784cc6825607c517d7565049108d1f908a1d71b
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sat May 28 11:36:55 2011 +0100

    builder: Initialize state fields
    
    If we're calling g_free() on a field we better make sure that it's either
    NULL or contains valid data.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=651271

 json-glib/json-builder.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/json-glib/json-builder.c b/json-glib/json-builder.c
index 14e7d18..9fa6859 100644
--- a/json-glib/json-builder.c
+++ b/json-glib/json-builder.c
@@ -268,6 +268,7 @@ json_builder_begin_object (JsonBuilder *builder)
 
   state = g_slice_new (JsonBuilderState);
   state->data.object = object;
+  state->member_name = NULL;
   state->mode = JSON_BUILDER_MODE_OBJECT;
   g_queue_push_head (builder->priv->stack, state);
 



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