From: Eric Haszlakiewicz Date: Thu, 11 Aug 2016 21:03:16 +0000 (-0400) Subject: Revert bogus change to json_object_get() made in f40b08d8 that caused it to always... X-Git-Tag: json-c-0.13-20171207~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d62de38982d3110f3ab5998fc99b4b50f00ebb7;p=thirdparty%2Fjson-c.git Revert bogus change to json_object_get() made in f40b08d8 that caused it to always return NULL. (Issue #259) 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. --- diff --git a/json_object.c b/json_object.c index c9284001..ecfdc328 100644 --- a/json_object.c +++ b/json_object.c @@ -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) diff --git a/json_tokener.c b/json_tokener.c index b5a58185..af4804d7 100644 --- a/json_tokener.c +++ b/json_tokener.c @@ -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; }