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
#include <opensrf/log.h>
#include <opensrf/osrf_json.h>
#include <opensrf/osrf_json_utils.h>
+#include <opensrf/osrf_utf8.h>
/* cleans up an object if it is morphing another object, also
* verifies that the appropriate storage container exists where appropriate */
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;
}