]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: Destroy ocsp update http_client during cleanup
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Tue, 28 Feb 2023 16:46:18 +0000 (17:46 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Thu, 2 Mar 2023 14:37:07 +0000 (15:37 +0100)
If a deinit is started while an OCSP update is in progress we might end
up with a dangling http_client instance that should be destroyed
properly.

src/ssl_ocsp.c

index 99edfc8750410da3aedf427aba2f0e30737c6403..ef624b0733d827b9e84cad6bf47b5d19c0595bd2 100644 (file)
@@ -846,6 +846,11 @@ void ssl_destroy_ocsp_update_task(void)
 
        ssl_sock_free_ocsp(ssl_ocsp_task_ctx.cur_ocsp);
        ssl_ocsp_task_ctx.cur_ocsp = NULL;
+
+       if (ssl_ocsp_task_ctx.hc) {
+               httpclient_stop_and_destroy(ssl_ocsp_task_ctx.hc);
+               ssl_ocsp_task_ctx.hc = NULL;
+       }
 }
 
 static inline void ssl_ocsp_set_next_update(struct certificate_ocsp *ocsp)