Avoid resource leak (#15827)
Avoid resource leak -- CID 398199
Stelios Fragkakis committed
Aug 17, 2023 at 18:28 UTC
6420e675f4324c0f75a54c6c3e6f460ed935a31f
1 file changed
+3
web/api/web_api.c
+3
@@ -73,6 +73,9 @@ int web_client_api_request_vX(RRDHOST *host, struct web_client *w, char *url_pat
73
return HTTP_RESP_BAD_REQUEST;
74
}
75
76
+ if (api_command != url_path_endpoint)
77
+ freez(api_command);
78
+
79
short int code = web_client_check_acl_and_bearer(w, api_commands[i].acl);
80
if(code != HTTP_RESP_OK) {
81
if(code == HTTP_RESP_FORBIDDEN)