@@ -1704,6 +1704,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, size_t fname_len, char
1704
1704
php_stream_filter_append (& temp -> writefilters , filter );
1705
1705
1706
1706
if (SUCCESS != php_stream_copy_to_stream_ex (fp , temp , PHP_STREAM_COPY_ALL , NULL )) {
1707
+ php_stream_filter_remove (filter , 1 );
1707
1708
if (err ) {
1708
1709
php_stream_close (temp );
1709
1710
MAPPHAR_ALLOC_FAIL ("unable to decompress gzipped phar archive \"%s\", ext/zlib is buggy in PHP versions older than 5.2.6" )
@@ -1750,6 +1751,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, size_t fname_len, char
1750
1751
php_stream_filter_append (& temp -> writefilters , filter );
1751
1752
1752
1753
if (SUCCESS != php_stream_copy_to_stream_ex (fp , temp , PHP_STREAM_COPY_ALL , NULL )) {
1754
+ php_stream_filter_remove (filter , 1 );
1753
1755
php_stream_close (temp );
1754
1756
MAPPHAR_ALLOC_FAIL ("unable to decompress bzipped phar archive \"%s\" to temporary file" )
1755
1757
}
@@ -2833,6 +2835,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
2833
2835
}
2834
2836
entry -> cfp = shared_cfp ;
2835
2837
if (!entry -> cfp ) {
2838
+ php_stream_filter_free (filter );
2836
2839
if (error ) {
2837
2840
spprintf (error , 0 , "unable to create temporary file" );
2838
2841
}
@@ -2847,6 +2850,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
2847
2850
entry -> header_offset = php_stream_tell (entry -> cfp );
2848
2851
php_stream_flush (file );
2849
2852
if (-1 == phar_seek_efp (entry , 0 , SEEK_SET , 0 , 0 )) {
2853
+ php_stream_filter_free (filter );
2850
2854
if (closeoldfile ) {
2851
2855
php_stream_close (oldfile );
2852
2856
}
@@ -2858,6 +2862,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
2858
2862
}
2859
2863
php_stream_filter_append ((& entry -> cfp -> writefilters ), filter );
2860
2864
if (SUCCESS != php_stream_copy_to_stream_ex (file , entry -> cfp , entry -> uncompressed_filesize , NULL )) {
2865
+ php_stream_filter_remove (filter , 1 );
2861
2866
if (closeoldfile ) {
2862
2867
php_stream_close (oldfile );
2863
2868
}
0 commit comments