]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: Fix to earlier http_client_connection_unref() change 1dead6
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 22 Feb 2016 23:48:47 +0000 (01:48 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 22 Feb 2016 23:48:47 +0000 (01:48 +0200)
Patch by Stephan Bosch

src/lib-http/http-client-connection.c

index 43c6d1f31c628591fe8ee6507f9d6d244912af3c..17f891793aa4c7bf20706a67e10cf31fb28c4b55 100644 (file)
@@ -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) {