diff --git a/NEWS b/NEWS index 56aa5d51bb2ad..ceda8d103caa8 100644 --- a/NEWS +++ b/NEWS @@ -56,6 +56,10 @@ PHP NEWS - PHPDBG: . Fixed bug GH-12675 (MEMORY_LEAK in phpdbg_prompt.c). (nielsdos) +- SOAP: + . Fixed bug GH-12838 ([SOAP] Temporary WSDL cache files not being deleted). + (nielsdos) + - SPL: . Fixed bug GH-12721 (SplFileInfo::getFilename() segfault in combination with GlobIterator and no directory separator). (nielsdos) diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 5c833dc45cf04..749f5a5685ec2 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -2381,7 +2381,9 @@ static void add_sdl_to_cache(const char *fn, const char *uri, time_t t, sdlPtr s /* Make sure that incomplete files (e.g. due to disk space issues, see bug #66150) are not utilised. */ if (valid_file) { /* This is allowed to fail, this means that another process was raced to create the file. */ - (void) VCWD_RENAME(ZSTR_VAL(temp_file_path), fn); + if (VCWD_RENAME(ZSTR_VAL(temp_file_path), fn) < 0) { + VCWD_UNLINK(ZSTR_VAL(temp_file_path)); + } } smart_str_free(&buf);