Module: kamailio
Branch: master
Commit: 1460d4448aa0c64569a6f35347f46d7df4dbcd09
URL:
https://github.com/kamailio/kamailio/commit/1460d4448aa0c64569a6f35347f46d7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-12-23T15:07:34+01:00
jsonrpcs: print log messages in case of errors inside struct_add
---
Modified: src/modules/jsonrpcs/jsonrpcs_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1460d4448aa0c64569a6f35347f46d7…
Patch:
https://github.com/kamailio/kamailio/commit/1460d4448aa0c64569a6f35347f46d7…
---
diff --git a/src/modules/jsonrpcs/jsonrpcs_mod.c b/src/modules/jsonrpcs/jsonrpcs_mod.c
index 8bb2f6c..c9ccea3 100644
--- a/src/modules/jsonrpcs/jsonrpcs_mod.c
+++ b/src/modules/jsonrpcs/jsonrpcs_mod.c
@@ -741,7 +741,10 @@ static int jsonrpc_struct_add(srjson_t *jnode, char* fmt, ...)
nj = jsonrpc_print_value(ctx, *fmt, &ap);
}
- if(nj==NULL) goto err;
+ if(nj==NULL) {
+ LM_ERR("failed to print the value (%c)\n", *fmt);
+ goto err;
+ }
if(isobject) {
/* add as member to object */
srjson_AddItemToObject(ctx->jrpl, jnode, mname.s, nj);
@@ -749,6 +752,7 @@ static int jsonrpc_struct_add(srjson_t *jnode, char* fmt, ...)
/* wrap member in a new object and add to array */
wj = srjson_CreateObject(ctx->jrpl);
if(wj==NULL) {
+ LM_ERR("failed to create object (%c)\n", *fmt);
srjson_Delete(ctx->jrpl, nj);
goto err;
}