From: otherddn1978 Date: Wed, 12 Feb 2025 10:54:46 +0000 (+0300) Subject: EC_get_buildin_curves does not return an error, this check is unnecessary. X-Git-Tag: openssl-3.5.0-alpha1~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1a501a433b59d3c57f3ab37ea202f5f1f19a054;p=thirdparty%2Fopenssl.git 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) --- 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)