From: Marcus Boerger Date: Tue, 9 Jan 2007 23:23:12 +0000 (+0000) Subject: - Fix write support & simplify X-Git-Tag: RELEASE_1_0_0RC1~327 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7d57a48145d0fb88c7e3fe85688b0932b91dde1;p=php - Fix write support & simplify --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index fb45afcb2b..a92c9b8d59 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -225,7 +225,7 @@ static void phar_destroy_phar_data(phar_archive_data *data TSRMLS_DC) /* {{{ */ if (data->fp) { php_stream_close(data->fp); } - data->fp = 0; + efree(data); } /* }}}*/ @@ -1923,11 +1923,7 @@ static int phar_flush(phar_entry_data *data TSRMLS_DC) /* {{{ */ /* remove this from the new phar */ continue; } - if (entry->flags & PHAR_ENT_MODIFIED) { - if (!entry->temp_file) { - /* nothing to do here */ - continue; - } + if ((entry->flags & PHAR_ENT_MODIFIED) && entry->temp_file) { php_stream_rewind(entry->temp_file); file = entry->temp_file; } else {