diff --git a/src/parser/neu_json_tag.c b/src/parser/neu_json_tag.c index e29052ca..64eec1a0 100644 --- a/src/parser/neu_json_tag.c +++ b/src/parser/neu_json_tag.c @@ -294,7 +294,8 @@ int neu_json_decode_add_tags_req(char *buf, neu_json_add_tags_req_t **result) json_obj = neu_json_decode_new(buf); if (NULL == json_obj) { - goto decode_fail; + free(req); + return -1; } neu_json_elem_t req_elems[] = { @@ -565,7 +566,8 @@ int neu_json_decode_add_gtags_req(char *buf, neu_json_add_gtags_req_t **result) json_obj = neu_json_decode_new(buf); if (NULL == json_obj) { - goto decode_fail; + free(req); + return -1; } neu_json_elem_t req_elems[] = { @@ -659,6 +661,10 @@ int neu_json_decode_del_tags_req(char *buf, neu_json_del_tags_req_t **result) } json_obj = neu_json_decode_new(buf); + if (NULL == json_obj) { + free(req); + return -1; + } neu_json_elem_t req_elems[] = { { .name = "node", @@ -775,7 +781,8 @@ int neu_json_decode_update_tags_req(char * buf, json_obj = neu_json_decode_new(buf); if (NULL == json_obj) { - goto decode_fail; + free(req); + return -1; } neu_json_elem_t req_elems[] = {