fix patch in previous, from tb@. the stack members also need to be

freed, not just the stack itself.
This commit is contained in:
sthen
2026-03-12 00:49:59 +00:00
parent e63865f9f2
commit 5ea0fff811
4 changed files with 4 additions and 2 deletions
+1
View File
@@ -1,4 +1,5 @@
PHP_VERSION= 8.4.19
REVISION-main= 0
AUTOCONF_VERSION= 2.72
PHP_PKGSPEC= >=8.4,<8.5
@@ -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;
+1
View File
@@ -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
@@ -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;