From: Christos Tsantilas Date: Thu, 18 Apr 2013 05:33:28 +0000 (-0600) Subject: Bug 3817: Memory leak in SSL cert validate for alt_name peer certs X-Git-Tag: SQUID_3_3_4~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d137ea0d2452da77988ed4c67cc97773a0949ab;p=thirdparty%2Fsquid.git Bug 3817: Memory leak in SSL cert validate for alt_name peer certs Inside function Ssl::matchX509CommonNames which checks a domain name against certificate common name and alternate names, if the domain matches any of the alternate names the function return without releasing allocated data. --- diff --git a/src/ssl/support.cc b/src/ssl/support.cc index 4fe762e1c1..e5b361cd41 100644 --- a/src/ssl/support.cc +++ b/src/ssl/support.cc @@ -190,8 +190,10 @@ int Ssl::matchX509CommonNames(X509 *peer_cert, void *check_data, int (*check_fun } ASN1_STRING *cn_data = check->d.dNSName; - if ( (*check_func)(check_data, cn_data) == 0) + if ( (*check_func)(check_data, cn_data) == 0) { + sk_GENERAL_NAME_pop_free(altnames, GENERAL_NAME_free); return 1; + } } sk_GENERAL_NAME_pop_free(altnames, GENERAL_NAME_free); }