Skip to content

Commit 15af912

Browse files
bnoordhuisFishrock123
authored andcommittedNov 22, 2016
src: fix memory leak introduced in 34febfb
Fix leaking the BIO in the error path. Introduced in commit 34febfb ("crypto: fix handling of root_cert_store"). PR-URL: #9604 Refs: #9409 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
1 parent 786631c commit 15af912

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎src/node_crypto.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -770,9 +770,8 @@ void SecureContext::AddCRL(const FunctionCallbackInfo<Value>& args) {
770770
PEM_read_bio_X509_CRL(bio, nullptr, CryptoPemCallback, nullptr);
771771

772772
if (crl == nullptr) {
773-
return env->ThrowError("Failed to parse CRL");
774773
BIO_free_all(bio);
775-
return;
774+
return env->ThrowError("Failed to parse CRL");
776775
}
777776

778777
X509_STORE* cert_store = SSL_CTX_get_cert_store(sc->ctx_);

0 commit comments

Comments
 (0)
Please sign in to comment.