diff --git a/NEWS b/NEWS index ba2e54628a3..45610bb0ccf 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,10 @@ PHP NEWS . Fixed JIT bug (JIT emits "Attempt to assign property of non-object" warning at the same time as Error is being thrown). (Girgias) +- SOAP: + . Fixed bug GH-12838 ([SOAP] Temporary WSDL cache files not being deleted). + (nielsdos) + - Standard . Fixed GH-12745 (http_build_query() default null argument for $arg_separator is implicitly coerced to string). (Girgias) diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 5c833dc45cf..749f5a5685e 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);