From e1a501a433b59d3c57f3ab37ea202f5f1f19a054 Mon Sep 17 00:00:00 2001 From: otherddn1978 Date: Wed, 12 Feb 2025 13:54:46 +0300 Subject: [PATCH] EC_get_buildin_curves does not return an error, this check is unnecessary. Found by Linux Verification Center (linuxtesting.org) with SVACE. unused code has been removed delete whitespace Reviewed-by: Dmitry Belyavskiy Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/26719) --- apps/ecparam.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/ecparam.c b/apps/ecparam.c index 9c9b3e05063..b05a0804527 100644 --- a/apps/ecparam.c +++ b/apps/ecparam.c @@ -67,13 +67,11 @@ const OPTIONS ecparam_options[] = { static int list_builtin_curves(BIO *out) { - int ret = 0; EC_builtin_curve *curves = NULL; size_t n, crv_len = EC_get_builtin_curves(NULL, 0); curves = app_malloc((int)sizeof(*curves) * crv_len, "list curves"); - if (!EC_get_builtin_curves(curves, crv_len)) - goto end; + EC_get_builtin_curves(curves, crv_len); for (n = 0; n < crv_len; n++) { const char *comment = curves[n].comment; @@ -87,10 +85,8 @@ static int list_builtin_curves(BIO *out) BIO_printf(out, " %-10s: ", sname); BIO_printf(out, "%s\n", comment); } - ret = 1; -end: OPENSSL_free(curves); - return ret; + return 1; } int ecparam_main(int argc, char **argv) -- 2.47.2