Skip to content

Commit a9eb093

Browse files
bnoordhuisMylesBorins
authored andcommitted
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 <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Rod Vagg <rod@vagg.org>
1 parent 35a660e commit a9eb093

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/node_crypto.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,9 +787,8 @@ void SecureContext::AddCRL(const FunctionCallbackInfo<Value>& args) {
787787
PEM_read_bio_X509_CRL(bio, nullptr, CryptoPemCallback, nullptr);
788788

789789
if (crl == nullptr) {
790-
return env->ThrowError("Failed to parse CRL");
791790
BIO_free_all(bio);
792-
return;
791+
return env->ThrowError("Failed to parse CRL");
793792
}
794793

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

0 commit comments

Comments
 (0)