From 32e091260aeb6192caa760e8cf87837f63d1c66a Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 20 Apr 2025 22:57:58 +0200 Subject: [PATCH] Fix GH-17403: Potential deadlock when putenv fails Closes GH-18368. --- NEWS | 3 +++ ext/standard/basic_functions.c | 1 + 2 files changed, 4 insertions(+) diff --git a/NEWS b/NEWS index bf57077f454..409972a1fe9 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,9 @@ PHP NEWS inaccurate sunrise and sunset times, but other calculated times are correct) (JiriJozif). +- Standard: + . Fixed bug GH-17403 (Potential deadlock when putenv fails). (nielsdos) + 08 May 2025, PHP 8.3.21 - Core: diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 99d92af167f..d2a99fccc95 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -849,6 +849,7 @@ PHP_FUNCTION(putenv) #endif RETURN_TRUE; } else { + tsrm_env_unlock(); free(pe.putenv_string); zend_string_release(pe.key); #ifdef PHP_WIN32