]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http-client: Prevented http_client_request_continue_payload() from segfault...
authorStephan Bosch <stephan@rename-it.nl>
Sun, 27 Apr 2014 16:05:38 +0000 (19:05 +0300)
committerStephan Bosch <stephan@rename-it.nl>
Sun, 27 Apr 2014 16:05:38 +0000 (19:05 +0300)
src/lib-http/http-client-request.c

index d0a5ebcafbc61662e0332ce22df096b594b1392c..c77b168d4981f1d7f9263eb990a7699a5deff8cb 100644 (file)
@@ -524,7 +524,13 @@ http_client_request_continue_payload(struct http_client_request **_req,
        }
 
        req->payload_wait = FALSE;
-       http_client_request_unref(_req);
+
+       /* callback may have messed with our pointer,
+          so unref using local variable */     
+       http_client_request_unref(&req);
+       if (req == NULL)
+               *_req = NULL;
+
        if (conn != NULL)
                http_client_connection_unref(&conn);