File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2785,7 +2785,9 @@ inline bool CertIsStartComOrWoSign(X509_NAME* name) {
2785
2785
startcom_wosign_data = dn.data ;
2786
2786
startcom_wosign_name = d2i_X509_NAME (nullptr , &startcom_wosign_data,
2787
2787
dn.len );
2788
- if (X509_NAME_cmp (name, startcom_wosign_name) == 0 )
2788
+ int cmp = X509_NAME_cmp (name, startcom_wosign_name);
2789
+ X509_NAME_free (startcom_wosign_name);
2790
+ if (cmp == 0 )
2789
2791
return true ;
2790
2792
}
2791
2793
@@ -2830,8 +2832,10 @@ inline CheckResult CheckWhitelistedServerCert(X509_STORE_CTX* ctx) {
2830
2832
}
2831
2833
2832
2834
X509* leaf_cert = sk_X509_value (chain, 0 );
2833
- if (!CheckStartComOrWoSign (root_name, leaf_cert))
2835
+ if (!CheckStartComOrWoSign (root_name, leaf_cert)) {
2836
+ sk_X509_pop_free (chain, X509_free);
2834
2837
return CHECK_CERT_REVOKED;
2838
+ }
2835
2839
2836
2840
// When the cert is issued from either CNNNIC ROOT CA or CNNNIC EV
2837
2841
// ROOT CA, check a hash of its leaf cert if it is in the whitelist.
You can’t perform that action at this time.
0 commit comments