http-api: Fix leak on error

This commit is contained in:
Roger A. Light 2025-10-22 16:15:20 +01:00
parent 154f5b1d50
commit ac5d7ba2b5

View file

@ -366,6 +366,7 @@ static int check_access(struct mosquitto__listener *listener, struct MHD_Connect
char *buf = "Not authorised\n";
struct MHD_Response *response = MHD_create_response_from_buffer(strlen(buf), (void *)buf, MHD_RESPMEM_MUST_COPY);
MHD_queue_basic_auth_fail_response(connection, "Mosquitto API", response);
MHD_destroy_response(response);
return MOSQ_ERR_AUTH;
}