Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Prevent double free of request.
Browse files Browse the repository at this point in the history
When freeing a request, nullify the current request pointer
in the associated connection to prevent the request from
being doubly freed when the connection is freed.
  • Loading branch information
Martin Hedenfalk authored and adamel committed Oct 6, 2014
1 parent ab2f567 commit ec445f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions evhtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,9 @@ _evhtp_request_free(evhtp_request_t * request) {
evhtp_headers_free(request->headers_in);
evhtp_headers_free(request->headers_out);

if (request->conn && request->conn->request == request) {
request->conn->request = NULL;
}

if (request->buffer_in) {
evbuffer_free(request->buffer_in);
Expand Down

0 comments on commit ec445f9

Please sign in to comment.