1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

phar: Fix potential double free on Windows (#20211)

Because the code no longer bails out, these variables shouldn't be freed
here as they're already freed by the caller.
This also simplifies the code.
Fixes nightly.
This commit is contained in:
Niels Dossche
2025-10-18 23:58:20 +02:00
committed by GitHub
parent bd82e8d149
commit 560a16fa19

View File

@@ -184,9 +184,6 @@ static phar_action_status phar_file_action(phar_archive_data *phar, phar_entry_i
highlight_file(name, &syntax_highlighter_ini);
efree(name);
#ifdef PHP_WIN32
efree(arch);
#endif
return PHAR_ACT_DO_EXIT;
case PHAR_MIME_OTHER:
/* send headers, output file contents */
@@ -274,9 +271,6 @@ static phar_action_status phar_file_action(phar_archive_data *phar, phar_entry_i
}
zend_destroy_file_handle(&file_handle);
#ifdef PHP_WIN32
efree(arch);
#endif
if (new_op_array) {
ZVAL_UNDEF(&result);