BUG/MINOR: ssl: Remove unneeded pointer check in ocsp cli release function
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Tue, 10 Jan 2023 10:21:40 +0000 (11:21 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 11 Jan 2023 10:20:11 +0000 (11:20 +0100)
The ctx pointer cannot be NULL so we can remove the check.

This patch fixes GitHub issue #1996.
It does not need to be backported.

src/ssl_ocsp.c

index 46dba88..017f018 100644 (file)
@@ -1432,8 +1432,7 @@ static void cli_release_update_ocsp_response(struct appctx *appctx)
        struct ocsp_cli_ctx *ctx = appctx->svcctx;
        struct httpclient *hc = ctx->hc;
 
-       if (ctx)
-               X509_free(ctx->ocsp_issuer);
+       X509_free(ctx->ocsp_issuer);
 
        /* Everything possible was printed on the CLI, we can destroy the client */
        httpclient_stop_and_destroy(hc);