]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: client: Clear request pointer immediately in http_client_request_error().
authorStephan Bosch <stephan.bosch@dovecot.fi>
Fri, 17 Mar 2017 22:18:52 +0000 (23:18 +0100)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 27 Mar 2017 09:43:22 +0000 (12:43 +0300)
src/lib-http/http-client-request.c

index af463ca93e087c388987bf607aae641e5d2ca1a9..e6d7449c4524444c69405e46b161c3508f25b327 100644 (file)
@@ -1217,6 +1217,8 @@ void http_client_request_error(struct http_client_request **_req,
 {
        struct http_client_request *req = *_req;
 
+       *_req = NULL;
+
        i_assert(req->state < HTTP_REQUEST_STATE_FINISHED);
        req->state = HTTP_REQUEST_STATE_ABORTED;
 
@@ -1236,7 +1238,6 @@ void http_client_request_error(struct http_client_request **_req,
                if (http_client_request_send_error(req, status, error))
                        http_client_request_destroy(&req);
        }
-       *_req = NULL;
 }
 
 void http_client_request_abort(struct http_client_request **_req)