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 @@ -2760,7 +2760,9 @@ inline bool CertIsStartComOrWoSign(X509_NAME* name) {
2760
2760
startcom_wosign_data = dn.data ;
2761
2761
startcom_wosign_name = d2i_X509_NAME (nullptr , &startcom_wosign_data,
2762
2762
dn.len );
2763
- if (X509_NAME_cmp (name, startcom_wosign_name) == 0 )
2763
+ int cmp = X509_NAME_cmp (name, startcom_wosign_name);
2764
+ X509_NAME_free (startcom_wosign_name);
2765
+ if (cmp == 0 )
2764
2766
return true ;
2765
2767
}
2766
2768
@@ -2805,8 +2807,10 @@ inline CheckResult CheckWhitelistedServerCert(X509_STORE_CTX* ctx) {
2805
2807
}
2806
2808
2807
2809
X509* leaf_cert = sk_X509_value (chain, 0 );
2808
- if (!CheckStartComOrWoSign (root_name, leaf_cert))
2810
+ if (!CheckStartComOrWoSign (root_name, leaf_cert)) {
2811
+ sk_X509_pop_free (chain, X509_free);
2809
2812
return CHECK_CERT_REVOKED;
2813
+ }
2810
2814
2811
2815
// When the cert is issued from either CNNNIC ROOT CA or CNNNIC EV
2812
2816
// 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