#include <mon_internal.h>
-// Monitoring request decoders
+/* Monitoring request decoders */
/**
* Decode a single option
&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;
}
*
* (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
cleanup:
talloc_free(tmp_ctx);
- if (req_json)
- json_decref(req_json);
return req;
}