Fix GH-17403: Potential deadlock when putenv fails

Closes GH-18368.
This commit is contained in:
Niels Dossche 2025-04-20 22:57:58 +02:00
parent 438f07c9f7
commit 32e091260a
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
2 changed files with 4 additions and 0 deletions

View file

@ -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