]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http_client_request_abort(NULL) should be a no-op
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Fri, 25 May 2018 23:11:35 +0000 (19:11 -0400)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 13 Jun 2018 07:25:37 +0000 (07:25 +0000)
src/lib-http/http-client-request.c

index dddadd8975b2caa898db4db80d722dda63f68b4a..b9141a83f94c8f8e31278eab258c4e8351138951 100644 (file)
@@ -1477,7 +1477,12 @@ void http_client_request_error(struct http_client_request **_req,
 void http_client_request_abort(struct http_client_request **_req)
 {
        struct http_client_request *req = *_req;
-       bool sending = (req->state == HTTP_REQUEST_STATE_PAYLOAD_OUT);
+       bool sending;
+
+       if (req == NULL)
+               return;
+
+       sending = (req->state == HTTP_REQUEST_STATE_PAYLOAD_OUT);
 
        *_req = NULL;