@@ -967,7 +967,7 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int
967967 int closeoldfile , free_user_stub ;
968968 size_t signature_length ;
969969 struct _phar_pass_tar_info pass ;
970- char * buf , * signature , * tmp , sigbuf [8 ];
970+ char * buf , * signature , sigbuf [8 ];
971971 char halt_stub [] = "__HALT_COMPILER();" ;
972972
973973 entry .flags = PHAR_ENT_PERM_DEF_FILE ;
@@ -1063,9 +1063,7 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int
10631063 free_user_stub = 0 ;
10641064 }
10651065
1066- tmp = estrndup (user_stub , len );
1067- if ((pos = php_stristr (tmp , halt_stub , len , sizeof (halt_stub ) - 1 )) == NULL ) {
1068- efree (tmp );
1066+ if ((pos = php_stristr (user_stub , halt_stub , len , sizeof (halt_stub ) - 1 )) == NULL ) {
10691067 if (error ) {
10701068 spprintf (error , 0 , "illegal stub for tar-based phar \"%s\"" , phar -> fname );
10711069 }
@@ -1074,8 +1072,7 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int
10741072 }
10751073 return EOF ;
10761074 }
1077- pos = user_stub + (pos - tmp );
1078- efree (tmp );
1075+ pos = user_stub + (pos - user_stub );
10791076
10801077 len = pos - user_stub + 18 ;
10811078 entry .fp = php_stream_fopen_tmpfile ();
0 commit comments