Skip to content

Commit a40989f

Browse files
tniessendanielleadams
authored andcommitted
crypto: fix error capture when loading engine
PR-URL: #41187 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
1 parent 115775f commit a40989f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/crypto/crypto_util.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,8 @@ EnginePointer LoadEngineById(const char* id, CryptoErrorStore* errors) {
597597
}
598598

599599
if (!engine && errors != nullptr) {
600-
if (ERR_get_error() != 0) {
601-
errors->Capture();
602-
} else {
600+
errors->Capture();
601+
if (errors->Empty()) {
603602
errors->Insert(NodeCryptoError::ENGINE_NOT_FOUND, id);
604603
}
605604
}

0 commit comments

Comments
 (0)