diff --git a/src/modules/json/json_funcs.c b/src/modules/json/json_funcs.c index 935877f6514..2de892154bc 100644 --- a/src/modules/json/json_funcs.c +++ b/src/modules/json/json_funcs.c @@ -56,9 +56,8 @@ int json_get_field(struct sip_msg* msg, char* json, char* field, char* dst) j = json_tokener_parse(json_s.s); - if (is_error(j)) { + if (j==NULL) { LM_ERR("empty or invalid JSON\n"); - if(j!=NULL) json_object_put(j); return -1; } @@ -74,6 +73,6 @@ int json_get_field(struct sip_msg* msg, char* json, char* field, char* dst) ret = -1; } - if(j!=NULL) json_object_put(j); + json_object_put(j); return ret; }