X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=blobdiff_plain;f=mon%2Fmon_req_decode.c;h=2d05620519bd7fe283c74534ee9e06a804a4b7e2;hp=0c7e7f47d61ff51bf844b285e341ba54bd128e6e;hb=7458d6a285fa526fd8cec03e1bbb497650a0e405;hpb=6491f2a660c3183b210b968a939eaa18f1b44a09 diff --git a/mon/mon_req_decode.c b/mon/mon_req_decode.c index 0c7e7f4..2d05620 100644 --- a/mon/mon_req_decode.c +++ b/mon/mon_req_decode.c @@ -38,7 +38,7 @@ #include -// Monitoring request decoders +/* Monitoring request decoders */ /** * Decode a single option @@ -98,7 +98,9 @@ static MON_RC mon_options_decode(json_t *opts_json, MON_REQ *req) &opt) != MON_SUCCESS) { return MON_NOPARSE; } - mon_req_add_option(req, opt.type); + if (MON_SUCCESS != mon_req_add_option(req, opt.type)){ + return MON_NOPARSE; + } } return MON_SUCCESS; } @@ -126,7 +128,7 @@ MON_REQ *mon_req_parse(TALLOC_CTX *mem_ctx, const char *input) * * (options are optional) * - * Caller must free the return value with MON_REQ_free(). + * Caller must free the return value with mon_req_free(). * * @param mem_ctx talloc context for the returned struct * @param req_json reference to JSON request object @@ -171,8 +173,6 @@ MON_REQ *mon_req_decode(TALLOC_CTX *mem_ctx, json_t *req_json) cleanup: talloc_free(tmp_ctx); - if (req_json) - json_decref(req_json); return req; }