Skip to content

Commit 0bc4529

Browse files
tniessentargos
authored andcommitted
crypto: remove unnecessary usage of goto
The control flow can easily be refactored to use break instead of goto. PR-URL: #23018 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent e7be1ed commit 0bc4529

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/node_crypto.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx,
591591
if (!r) {
592592
ret = 0;
593593
issuer = nullptr;
594-
goto end;
594+
break;
595595
}
596596
// Note that we must not free r if it was successfully
597597
// added to the chain (while we must free the main
@@ -618,12 +618,10 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx,
618618
issuer = X509_dup(issuer);
619619
if (issuer == nullptr) {
620620
ret = 0;
621-
goto end;
622621
}
623622
}
624623
}
625624

626-
end:
627625
issuer_->reset(issuer);
628626

629627
if (ret && x != nullptr) {

0 commit comments

Comments
 (0)