]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: Release ssl_ocsp_task_ctx.cur_ocsp when destroying task
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Mon, 9 Jan 2023 11:02:45 +0000 (12:02 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 9 Jan 2023 14:43:41 +0000 (15:43 +0100)
In the unlikely event that the OCSP udpate task is killed in the middle
of an update process (request sent but no response received yet) the
cur_ocsp member of the update context would keep an unneeded reference
to a certificate_ocsp object. It must then be freed during the task's
cleanup.

src/ssl_ocsp.c

index 165c16ca93387f6451e289edfe6cda7d0f27801d..4b1b65961f593395df5774461a9507b2c8c17410 100644 (file)
@@ -840,6 +840,9 @@ void ssl_destroy_ocsp_update_task(void)
 
        task_destroy(ocsp_update_task);
        ocsp_update_task = NULL;
+
+       ssl_sock_free_ocsp(ssl_ocsp_task_ctx.cur_ocsp);
+       ssl_ocsp_task_ctx.cur_ocsp = NULL;
 }
 
 /*