From 54d902146a927acb92096399e1b4738be4e96e41 Mon Sep 17 00:00:00 2001 From: simon987 Date: Sat, 1 Jul 2023 08:38:30 -0400 Subject: [PATCH] Free tag json if parsing failed --- src/web/serve.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/web/serve.c b/src/web/serve.c index b7b90d9..f31ee68 100644 --- a/src/web/serve.c +++ b/src/web/serve.c @@ -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; }