]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: httpclient: fixed memory allocation for the SSL ca_file
authorMiroslav Zagorac <mzagorac@haproxy.com>
Wed, 2 Nov 2022 15:11:50 +0000 (16:11 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 4 Nov 2022 10:29:18 +0000 (11:29 +0100)
commita2ec192de38eba294189bf94b76dbb2c4cf9a55b
tree0688042d1ef64456149e25742b7bd81b461dd5c5
parent1ef1b859d0ddb9ad68aa4e2b861a37387815a5e1
BUG/MINOR: httpclient: fixed memory allocation for the SSL ca_file

The memory for the SSL ca_file was allocated only once (in the function
httpclient_create_proxy()) and that pointer was assigned to each created
proxy that the HTTP client uses.  This would not be a problem if this
memory was not freed in each individual proxy when it was deinitialized
in the function ssl_sock_free_srv_ctx().

  Memory allocation:
    src/http_client.c, function httpclient_create_proxy():
      1277: if (!httpclient_ssl_ca_file)
      1278: httpclient_ssl_ca_file = strdup("@system-ca");
      1280: srv_ssl->ssl_ctx.ca_file = httpclient_ssl_ca_file;

  Memory deallocation:
    src/ssl_sock.c, function ssl_sock_free_srv_ctx():
      5613: ha_free(&srv->ssl_ctx.ca_file);

This should be backported to version 2.6.
src/http_client.c