(The existing implementation had sanity-checking code for the case where
its argument was NULL, but it erroneously dereferenced it before actually
doing the sanity-check. --nickm)
evhttp_send_reply_end(struct evhttp_request *req)
{
struct evhttp_connection *evcon = req->evcon;
- struct evbuffer *output = bufferevent_get_output(evcon->bufev);
+ struct evbuffer *output;
if (evcon == NULL) {
evhttp_request_free(req);
return;
}
+ output = bufferevent_get_output(evcon->bufev);
+
/* we expect no more calls form the user on this request */
req->userdone = 1;