From 560a16fa19ee040e5427b03cba7e97fab769c12d Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 18 Oct 2025 23:58:20 +0200 Subject: [PATCH] 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. --- ext/phar/phar_object.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 31b9261ba13..9c09417e077 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -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);