]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3114: Memory leak in SSL certificate verify code
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 20 Jul 2011 11:41:44 +0000 (23:41 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 20 Jul 2011 11:41:44 +0000 (23:41 +1200)
src/ssl_support.cc

index 546c4cbd541382fec09c5801b064424fb9b8b3e3..a3abb017e62f7cfbdbbd82c869cac1d749431069 100644 (file)
@@ -178,8 +178,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);
     }