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 @@ -2693,7 +2693,9 @@ inline bool CertIsStartComOrWoSign(X509_NAME* name) {
2693
2693
startcom_wosign_data = dn.data ;
2694
2694
startcom_wosign_name = d2i_X509_NAME (nullptr , &startcom_wosign_data,
2695
2695
dn.len );
2696
- if (X509_NAME_cmp (name, startcom_wosign_name) == 0 )
2696
+ int cmp = X509_NAME_cmp (name, startcom_wosign_name);
2697
+ X509_NAME_free (startcom_wosign_name);
2698
+ if (cmp == 0 )
2697
2699
return true ;
2698
2700
}
2699
2701
@@ -2738,8 +2740,10 @@ inline CheckResult CheckWhitelistedServerCert(X509_STORE_CTX* ctx) {
2738
2740
}
2739
2741
2740
2742
X509* leaf_cert = sk_X509_value (chain, 0 );
2741
- if (!CheckStartComOrWoSign (root_name, leaf_cert))
2743
+ if (!CheckStartComOrWoSign (root_name, leaf_cert)) {
2744
+ sk_X509_pop_free (chain, X509_free);
2742
2745
return CHECK_CERT_REVOKED;
2746
+ }
2743
2747
2744
2748
// When the cert is issued from either CNNNIC ROOT CA or CNNNIC EV
2745
2749
// 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