]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Revert bogus change to json_object_get() made in f40b08d8 that caused it to always...
authorEric Haszlakiewicz <erh+git@nimenees.com>
Thu, 11 Aug 2016 21:03:16 +0000 (17:03 -0400)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Thu, 11 Aug 2016 21:05:41 +0000 (17:05 -0400)
Also undo NULL check in json_tokener_set_flags(): it's not at all valid toi
 try to set flags on a NULL pointer, and doing so should not be silently
 ignored.

json_object.c
json_tokener.c

index c9284001446e65a2e4b20d09c5b26f37e783abaf..ecfdc328ac6eefb2dc2ef3afe753a44e1ccf7671 100644 (file)
@@ -172,7 +172,7 @@ extern struct json_object* json_object_get(struct json_object *jso)
 {
        if (jso)
                jso->_ref_count++;
-       return NULL;
+       return jso;
 }
 
 int json_object_put(struct json_object *jso)
index b5a58185e94dbd0b3a3f0559d43a060fa1dfe3bf..af4804d763023705895c750ad61a098e8e06bd22 100644 (file)
@@ -979,5 +979,5 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
 
 void json_tokener_set_flags(struct json_tokener *tok, int flags)
 {
-  if(tok) tok->flags = flags;
+       tok->flags = flags;
 }