From 01ea0c5c285eb0ebe56b848b7ae147eb7b4509c8 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Wed, 3 Feb 2010 16:54:18 -0800 Subject: [PATCH] make evhttp_send() safe against terminated connections, too --- http.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/http.c b/http.c index 3f5f8209..960074cf 100644 --- a/http.c +++ b/http.c @@ -1935,6 +1935,11 @@ evhttp_send(struct evhttp_request *req, struct evbuffer *databuf) { struct evhttp_connection *evcon = req->evcon; + if (evcon == NULL) { + evhttp_request_free(req); + return; + } + assert(TAILQ_FIRST(&evcon->requests) == req); /* we expect no more calls form the user on this request */