From 5ea0fff811a06dbc8d2e8209d98d8a62f2ca4fe2 Mon Sep 17 00:00:00 2001 From: sthen Date: Thu, 12 Mar 2026 00:49:59 +0000 Subject: [PATCH] fix patch in previous, from tb@. the stack members also need to be freed, not just the stack itself. --- lang/php/8.4/Makefile | 1 + lang/php/8.4/patches/patch-ext_openssl_openssl_c | 2 +- lang/php/8.5/Makefile | 1 + lang/php/8.5/patches/patch-ext_openssl_openssl_backend_common_c | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lang/php/8.4/Makefile b/lang/php/8.4/Makefile index 9819a7f0786..49df688c22b 100644 --- a/lang/php/8.4/Makefile +++ b/lang/php/8.4/Makefile @@ -1,4 +1,5 @@ PHP_VERSION= 8.4.19 +REVISION-main= 0 AUTOCONF_VERSION= 2.72 PHP_PKGSPEC= >=8.4,<8.5 diff --git a/lang/php/8.4/patches/patch-ext_openssl_openssl_c b/lang/php/8.4/patches/patch-ext_openssl_openssl_c index e859e835dbf..e0f8aefbc3c 100644 --- a/lang/php/8.4/patches/patch-ext_openssl_openssl_c +++ b/lang/php/8.4/patches/patch-ext_openssl_openssl_c @@ -25,7 +25,7 @@ Index: ext/openssl/openssl.c - sk_X509_push(stack,xi->x509); + if(sk_X509_push(stack,xi->x509) == 0) { + php_error_docref(NULL, E_ERROR, "Memory allocation failure"); -+ sk_X509_free(stack); ++ sk_X509_pop_free(stack,X509_free); + goto end; + } xi->x509=NULL; diff --git a/lang/php/8.5/Makefile b/lang/php/8.5/Makefile index e57bd74ff0f..4f810d08811 100644 --- a/lang/php/8.5/Makefile +++ b/lang/php/8.5/Makefile @@ -1,4 +1,5 @@ PHP_VERSION= 8.5.4 +REVISION-main= 0 AUTOCONF_VERSION= 2.71 # override PORTROACH from ../Makefile.inc; no marker wanted for the highest diff --git a/lang/php/8.5/patches/patch-ext_openssl_openssl_backend_common_c b/lang/php/8.5/patches/patch-ext_openssl_openssl_backend_common_c index 15d93fb7e86..d0d1221dca0 100644 --- a/lang/php/8.5/patches/patch-ext_openssl_openssl_backend_common_c +++ b/lang/php/8.5/patches/patch-ext_openssl_openssl_backend_common_c @@ -25,7 +25,7 @@ Index: ext/openssl/openssl_backend_common.c - sk_X509_push(stack,xi->x509); + if(sk_X509_push(stack,xi->x509) == 0) { + php_error_docref(NULL, E_ERROR, "Memory allocation failure"); -+ sk_X509_free(stack); ++ sk_X509_pop_free(stack,X509_free); + goto end; + } xi->x509=NULL;