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 @@ -2769,7 +2769,9 @@ inline bool CertIsStartComOrWoSign(X509_NAME* name) {
2769
2769
startcom_wosign_data = dn.data ;
2770
2770
startcom_wosign_name = d2i_X509_NAME (nullptr , &startcom_wosign_data,
2771
2771
dn.len );
2772
- if (X509_NAME_cmp (name, startcom_wosign_name) == 0 )
2772
+ int cmp = X509_NAME_cmp (name, startcom_wosign_name);
2773
+ X509_NAME_free (startcom_wosign_name);
2774
+ if (cmp == 0 )
2773
2775
return true ;
2774
2776
}
2775
2777
@@ -2814,8 +2816,10 @@ inline CheckResult CheckWhitelistedServerCert(X509_STORE_CTX* ctx) {
2814
2816
}
2815
2817
2816
2818
X509* leaf_cert = sk_X509_value (chain, 0 );
2817
- if (!CheckStartComOrWoSign (root_name, leaf_cert))
2819
+ if (!CheckStartComOrWoSign (root_name, leaf_cert)) {
2820
+ sk_X509_pop_free (chain, X509_free);
2818
2821
return CHECK_CERT_REVOKED;
2822
+ }
2819
2823
2820
2824
// When the cert is issued from either CNNNIC ROOT CA or CNNNIC EV
2821
2825
// 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