From: Tomas Mraz Date: Wed, 7 Jun 2023 11:33:40 +0000 (+0200) Subject: Coverity 1528496: remove assignment of unused value X-Git-Tag: openssl-3.2.0-alpha1~671 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0c6c3782870663dd190009103f22263f9a99c82e;p=thirdparty%2Fopenssl.git Coverity 1528496: remove assignment of unused value ctx is used only within the loop and always assigned at start --- diff --git a/crypto/asn1/i2d_evp.c b/crypto/asn1/i2d_evp.c index 0d66411be8f..e75a8b01523 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)