From 7d0cc67b61e7d9b9414fc0d37684e0e23b0b205a Mon Sep 17 00:00:00 2001 From: ndossche Date: Tue, 7 Jul 2026 13:55:07 +0200 Subject: [PATCH] Properly propagate X509_STORE_CTX_new() Propagating is consistent with other "new" failures, and avoids bailing out, which is inherently problematic anyway as it can cause persistent leaks on its own. --- ext/openssl/openssl_backend_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/openssl/openssl_backend_common.c b/ext/openssl/openssl_backend_common.c index 7261a617af32..8adf1ac813f1 100644 --- a/ext/openssl/openssl_backend_common.c +++ b/ext/openssl/openssl_backend_common.c @@ -750,7 +750,7 @@ int php_openssl_check_cert(X509_STORE *ctx, X509 *x, STACK_OF(X509) *untrustedch csc = X509_STORE_CTX_new(); if (csc == NULL) { php_openssl_store_errors(); - php_error_docref(NULL, E_ERROR, "Memory allocation failure"); + php_error_docref(NULL, E_WARNING, "Memory allocation failure"); return 0; } if (!X509_STORE_CTX_init(csc, ctx, x, untrustedchain)) {