From: Christos Tsantilas Date: Wed, 17 Apr 2013 08:14:56 +0000 (+0300) Subject: Bug 3817: Memory leak in SSL cert validate for alt_name peer certs X-Git-Tag: SQUID_3_4_0_1~200 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40dd2b59081c011c27ba5c7bfc8cbf9e5d90d4a6;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 c738c2fb42..c701bd6bda 100644 --- a/src/ssl/support.cc +++ b/src/ssl/support.cc @@ -191,8 +191,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); }