From ec828d772cde0e1dff02be97c15c76e87b73a7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C5=8Dan?= Date: Thu, 19 Mar 2026 00:20:45 -0600 Subject: [PATCH] refactor: remove dead EVP_PKEY_CTX_free(pctx) in _new_key_from_parameters() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both calls were unreachable: pctx is always freed and NULLed before these points — at line 738/761 on success paths, and at line 784 in the err: cleanup block. Removing them clarifies resource ownership and eliminates misleading cleanup code. Co-Authored-By: Claude Opus 4.6 --- RSA.xs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/RSA.xs b/RSA.xs index 65c8078..74b56b8 100644 --- a/RSA.xs +++ b/RSA.xs @@ -788,16 +788,10 @@ _new_key_from_parameters(proto, n, e, d, p, q) if (error) { EVP_PKEY_free(rsa); -#if OPENSSL_VERSION_NUMBER >= 0x30000000L - EVP_PKEY_CTX_free(pctx); -#endif CHECK_OPEN_SSL(0); } } end: -#if OPENSSL_VERSION_NUMBER >= 0x30000000L - EVP_PKEY_CTX_free(pctx); -#endif OUTPUT: RETVAL