]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: clean ret variable in ssl_sock_load_ckchn
authorEmmanuel Hocdet <manu@gandi.net>
Tue, 30 Jul 2019 15:17:03 +0000 (17:17 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 30 Jul 2019 15:54:35 +0000 (17:54 +0200)
In ssl_sock_load_ckchn, ret variable is now in a half dead usage.
Remove it to clean compilation warnings.

src/ssl_sock.c

index bcaf5eddc34d0df018f6521611847f6b7e205e5f..66b0aab8c57a7ebfbd8f2bfd4e82b3b10dbd78b9 100644 (file)
@@ -3424,7 +3424,6 @@ static int ssl_sock_load_ckchn(const char *path, struct ckch_node *ckch_n, struc
 {
        SSL_CTX *ctx;
        int i;
-       int ret = -1;
        int order = 0;
        X509_NAME *xname;
        char *str;
@@ -3502,16 +3501,12 @@ static int ssl_sock_load_ckchn(const char *path, struct ckch_node *ckch_n, struc
                        }
                }
        }
-
-       ret = 0; /* the caller must not free the SSL_CTX argument anymore */
-
        /* we must not free the SSL_CTX anymore below, since it's already in
         * the tree, so it will be discovered and cleaned in time.
         */
 
 #if (defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB && !defined OPENSSL_NO_OCSP)
-       ret = ssl_sock_load_ocsp(ctx, path);
-       if (ret < 0) {
+       if (ssl_sock_load_ocsp(ctx, path) < 0) {
                if (err)
                        memprintf(err, "%s '%s.ocsp' is present and activates OCSP but it is impossible to compute the OCSP certificate ID (maybe the issuer could not be found)'.\n",
                                  *err ? *err : "", path);
@@ -3523,8 +3518,7 @@ static int ssl_sock_load_ckchn(const char *path, struct ckch_node *ckch_n, struc
 
 #if (HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL && !defined OPENSSL_NO_TLSEXT && !defined OPENSSL_IS_BORINGSSL)
        if (sctl_ex_index >= 0) {
-               ret = ssl_sock_load_sctl(ctx, path);
-               if (ret < 0) {
+               if (ssl_sock_load_sctl(ctx, path) < 0) {
                        if (err)
                                memprintf(err, "%s '%s.sctl' is present but cannot be read or parsed'.\n",
                                          *err ? *err : "", path);