]> 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)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 26 May 2018 13:01:45 +0000 (13:01 +0000)
src/lib-http/http-client-request.c

index 8ba2f5df45729483bcaf9eb4c1b8c4b5917d8828..13d6a9565b594723d276e5a7f35f1b398a5d6b21 100644 (file)
@@ -1481,7 +1481,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;