From 0acbd7889343e1221406f848c32c95b3a07cbd09 Mon Sep 17 00:00:00 2001 From: scottmk Date: Thu, 12 Feb 2009 02:46:10 +0000 Subject: [PATCH] 1. Added a missing #include 2. In jsonNewIterator(): initialize hashItr to NULL if the object is not a JSON_HASH git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1659 9efc2488-bf62-4759-914b-345cdb29e865 --- src/libopensrf/osrf_json_object.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libopensrf/osrf_json_object.c b/src/libopensrf/osrf_json_object.c index 486ad2f..8a476be 100644 --- a/src/libopensrf/osrf_json_object.c +++ b/src/libopensrf/osrf_json_object.c @@ -20,6 +20,7 @@ GNU General Public License for more details. #include #include #include +#include /* cleans up an object if it is morphing another object, also * verifies that the appropriate storage container exists where appropriate */ @@ -382,12 +383,14 @@ jsonIterator* jsonNewIterator(const jsonObject* obj) { jsonIterator* itr; OSRF_MALLOC(itr, sizeof(jsonIterator)); - itr->obj = (jsonObject*) obj; - itr->index = 0; - itr->key = NULL; + itr->obj = (jsonObject*) obj; + itr->index = 0; + itr->key = NULL; if( obj->type == JSON_HASH ) itr->hashItr = osrfNewHashIterator(obj->value.h); + else + itr->hashItr = NULL; return itr; } -- 2.11.0