Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
crypto: remove unnecessary usage of goto
The control flow can easily be refactored to use break instead of
goto.
  • Loading branch information
tniessen committed Sep 22, 2018
commit ac1114b7644ab0f4b1001e968ac38d6c32f83862
4 changes: 1 addition & 3 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,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 @@ -617,12 +617,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