Free tag json if parsing failed

This commit is contained in:
simon987 2023-07-01 08:38:30 -04:00
parent 3b0ab3679a
commit 54d902146a

View File

@ -528,6 +528,7 @@ void tag(struct mg_connection *nc, struct mg_http_message *hm) {
tag_req_t *req = parse_tag_request(json);
if (req == NULL) {
LOG_DEBUGF("serve.c", "Could not parse tag request", arg_index);
cJSON_Delete(json);
HTTP_REPLY_BAD_REQUEST
return;
}