Module: kamailio
Branch: master
Commit: 0efa76d80e159fd2a7516388fe2405ad4fb6c5b6
URL:
https://github.com/kamailio/kamailio/commit/0efa76d80e159fd2a7516388fe2405a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-23T08:59:43+02:00
json: remove use of deprecated macro is_error()
---
Modified: src/modules/json/json_funcs.c
---
Diff:
https://github.com/kamailio/kamailio/commit/0efa76d80e159fd2a7516388fe2405a…
Patch:
https://github.com/kamailio/kamailio/commit/0efa76d80e159fd2a7516388fe2405a…
---
diff --git a/src/modules/json/json_funcs.c b/src/modules/json/json_funcs.c
index 935877f651..2de892154b 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;
}