exiting early when hash iterator returns null
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 16 May 2008 12:59:23 +0000 (12:59 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 16 May 2008 12:59:23 +0000 (12:59 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1324 9efc2488-bf62-4759-914b-345cdb29e865

src/libopensrf/osrf_json_object.c

index cadceb1..335d70e 100644 (file)
@@ -361,6 +361,7 @@ jsonObject* jsonIteratorNext(jsonIterator* itr) {
        if( itr->obj->type == JSON_HASH ) {
                if(!itr->hashItr) return NULL;
                jsonObject* item = osrfHashIteratorNext(itr->hashItr);
+        if(!item) return NULL;
                free(itr->key);
                itr->key = strdup( osrfHashIteratorKey(itr->hashItr) );
                return item;