From 3eb2adbb8ed5a09eee693c2f0c55b1233a8cdbdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Sat, 22 Sep 2018 12:15:49 +0200 Subject: [PATCH] crypto: remove unnecessary usage of goto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The control flow can easily be refactored to use break instead of goto. PR-URL: https://github.com/nodejs/node/pull/23018 Reviewed-By: Anna Henningsen Reviewed-By: Michaƫl Zasso Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater --- src/node_crypto.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 75f0ecb264a910..7cfcdc4ec61d9f 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -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 @@ -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) {