From 0c6c3782870663dd190009103f22263f9a99c82e Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Wed, 7 Jun 2023 13:33:40 +0200 Subject: [PATCH] Coverity 1528496: remove assignment of unused value ctx is used only within the loop and always assigned at start --- crypto/asn1/i2d_evp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crypto/asn1/i2d_evp.c b/crypto/asn1/i2d_evp.c index 0d66411be8..e75a8b0152 100644 --- a/crypto/asn1/i2d_evp.c +++ b/crypto/asn1/i2d_evp.c @@ -34,7 +34,6 @@ static int i2d_provided(const EVP_PKEY *a, int selection, const struct type_and_structure_st *output_info, unsigned char **pp) { - OSSL_ENCODER_CTX *ctx = NULL; int ret; for (ret = -1; @@ -49,6 +48,7 @@ static int i2d_provided(const EVP_PKEY *a, int selection, */ size_t len = INT_MAX; int pp_was_NULL = (pp == NULL || *pp == NULL); + OSSL_ENCODER_CTX *ctx; ctx = OSSL_ENCODER_CTX_new_for_pkey(a, selection, output_info->output_type, @@ -63,7 +63,6 @@ static int i2d_provided(const EVP_PKEY *a, int selection, ret = INT_MAX - (int)len; } OSSL_ENCODER_CTX_free(ctx); - ctx = NULL; } if (ret == -1)