Skip to content

Commit eddb453

Browse files
committed
add NULL check on MHD_create_response_from_buffer
1 parent d2e0ce9 commit eddb453

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/coraza_httpd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ static enum MHD_Result handle_request(void *cls,
147147

148148
struct MHD_Response *response = MHD_create_response_from_buffer(
149149
resp_len, (void*)resp_body, MHD_RESPMEM_MUST_COPY);
150+
if (!response) {
151+
coraza_free_transaction(tx);
152+
return MHD_NO;
153+
}
150154
enum MHD_Result ret = MHD_queue_response(connection, status, response);
151155
MHD_destroy_response(response);
152156

0 commit comments

Comments
 (0)