@@ -2533,7 +2533,6 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
2533
2533
{
2534
2534
static const char halt_stub [] = "__HALT_COMPILER();" ;
2535
2535
2536
- zend_string * newstub ;
2537
2536
phar_entry_info * entry , * newentry ;
2538
2537
size_t halt_offset ;
2539
2538
int restore_alias_len , global_flags = 0 ;
@@ -2636,35 +2635,35 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
2636
2635
phar -> halt_offset = len + end_sequence_len ;
2637
2636
} else {
2638
2637
size_t written ;
2638
+ zend_string * new_stub = NULL ;
2639
2639
2640
2640
if (!user_stub && phar -> halt_offset && oldfile && !phar -> is_brandnew ) {
2641
2641
php_stream_copy_to_stream_ex (oldfile , newfile , phar -> halt_offset , & written );
2642
- newstub = NULL ;
2643
2642
} else {
2644
2643
/* this is either a brand new phar or a default stub overwrite */
2645
- newstub = phar_create_default_stub (NULL , NULL , NULL );
2646
- phar -> halt_offset = ZSTR_LEN (newstub );
2647
- written = php_stream_write (newfile , ZSTR_VAL (newstub ), phar -> halt_offset );
2644
+ new_stub = phar_create_default_stub (NULL , NULL , NULL );
2645
+ phar -> halt_offset = ZSTR_LEN (new_stub );
2646
+ written = php_stream_write (newfile , ZSTR_VAL (new_stub ), phar -> halt_offset );
2648
2647
}
2649
2648
if (phar -> halt_offset != written ) {
2650
2649
if (must_close_old_file ) {
2651
2650
php_stream_close (oldfile );
2652
2651
}
2653
2652
php_stream_close (newfile );
2654
2653
if (error ) {
2655
- if (newstub ) {
2654
+ if (new_stub ) {
2656
2655
spprintf (error , 0 , "unable to create stub in new phar \"%s\"" , phar -> fname );
2657
2656
} else {
2658
2657
spprintf (error , 0 , "unable to copy stub of old phar to new phar \"%s\"" , phar -> fname );
2659
2658
}
2660
2659
}
2661
- if (newstub ) {
2662
- zend_string_free (newstub );
2660
+ if (new_stub ) {
2661
+ zend_string_free (new_stub );
2663
2662
}
2664
2663
return EOF ;
2665
2664
}
2666
- if (newstub ) {
2667
- zend_string_free (newstub );
2665
+ if (new_stub ) {
2666
+ zend_string_free (new_stub );
2668
2667
}
2669
2668
}
2670
2669
manifest_ftell = php_stream_tell (newfile );
0 commit comments