From: Timo Sirainen Date: Mon, 22 Feb 2016 23:48:47 +0000 (+0200) Subject: lib-http: Fix to earlier http_client_connection_unref() change 1dead6 X-Git-Tag: 2.2.22.rc1~87 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1a9b58ae3512ce0042e244cd2f86809e6be0148;p=thirdparty%2Fdovecot%2Fcore.git lib-http: Fix to earlier http_client_connection_unref() change 1dead6 Patch by Stephan Bosch --- diff --git a/src/lib-http/http-client-connection.c b/src/lib-http/http-client-connection.c index 43c6d1f31c..17f891793a 100644 --- a/src/lib-http/http-client-connection.c +++ b/src/lib-http/http-client-connection.c @@ -571,13 +571,15 @@ http_client_connection_return_response(struct http_client_request *req, conn->in_req_callback = TRUE; http_client_connection_ref(conn); retrying = !http_client_request_callback(req, response); - if (!http_client_connection_unref(&req->conn)) { + if (!http_client_connection_unref(&conn)) { /* the callback managed to get this connection destroyed */ + req->conn = NULL; if (!retrying) http_client_request_finish(req); http_client_request_unref(&req); return FALSE; } + conn = req->conn; conn->in_req_callback = FALSE; if (retrying) {