mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-22 19:31:02 +01:00
BUG/MINOR: ssl: memleak of the struct cert_key_and_chain
Free the struct cert_key_and_chain when calling ckchs_free(), a memory leak can occur when using 'commit ssl cert'. Must be backported to 2.1.
This commit is contained in:
parent
caa161982f
commit
8621ac5570
@ -3762,12 +3762,16 @@ void ckchs_free(struct ckch_store *ckchs)
|
|||||||
if (ckchs->multi) {
|
if (ckchs->multi) {
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
for (n = 0; n < SSL_SOCK_NUM_KEYTYPES; n++)
|
for (n = 0; n < SSL_SOCK_NUM_KEYTYPES; n++) {
|
||||||
ssl_sock_free_cert_key_and_chain_contents(&ckchs->ckch[n]);
|
ssl_sock_free_cert_key_and_chain_contents(&ckchs->ckch[n]);
|
||||||
|
}
|
||||||
|
free(ckchs->ckch);
|
||||||
|
ckchs->ckch = NULL;
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
ssl_sock_free_cert_key_and_chain_contents(ckchs->ckch);
|
ssl_sock_free_cert_key_and_chain_contents(ckchs->ckch);
|
||||||
|
free(ckchs->ckch);
|
||||||
ckchs->ckch = NULL;
|
ckchs->ckch = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user