Skip to content

Commit

Permalink
crypto: remove unnecessary usage of goto
Browse files Browse the repository at this point in the history
The control flow can easily be refactored to use break instead of
goto.

PR-URL: #23018
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
tniessen authored and targos committed Sep 25, 2018
1 parent e7be1ed commit 0bc4529
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx,
if (!r) {
ret = 0;
issuer = nullptr;
goto end;
break;
}
// Note that we must not free r if it was successfully
// added to the chain (while we must free the main
Expand All @@ -618,12 +618,10 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx,
issuer = X509_dup(issuer);
if (issuer == nullptr) {
ret = 0;
goto end;
}
}
}

end:
issuer_->reset(issuer);

if (ret && x != nullptr) {
Expand Down

0 comments on commit 0bc4529

Please sign in to comment.