Skip to content

Commit 560a16f

Browse files
authored
phar: Fix potential double free on Windows (php#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.
1 parent bd82e8d commit 560a16f

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

ext/phar/phar_object.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ static phar_action_status phar_file_action(phar_archive_data *phar, phar_entry_i
184184
highlight_file(name, &syntax_highlighter_ini);
185185

186186
efree(name);
187-
#ifdef PHP_WIN32
188-
efree(arch);
189-
#endif
190187
return PHAR_ACT_DO_EXIT;
191188
case PHAR_MIME_OTHER:
192189
/* send headers, output file contents */
@@ -274,9 +271,6 @@ static phar_action_status phar_file_action(phar_archive_data *phar, phar_entry_i
274271
}
275272

276273
zend_destroy_file_handle(&file_handle);
277-
#ifdef PHP_WIN32
278-
efree(arch);
279-
#endif
280274
if (new_op_array) {
281275
ZVAL_UNDEF(&result);
282276

0 commit comments

Comments
 (0)