From: Marcus Boerger Date: Fri, 10 Mar 2006 23:52:57 +0000 (+0000) Subject: - Fix issue with parser error in included phar:// entries X-Git-Tag: RELEASE_1_3~463 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d85294d0f4d0194c107296172fab301c30d13a3c;p=php - Fix issue with parser error in included phar:// entries --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 61b035d426..cbef8ee01f 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -910,6 +910,7 @@ static php_stream * php_stream_phar_url_wrapper(php_stream_wrapper *wrapper, cha /* do we have the data already? */ if (idata->fp) { fpf = php_stream_alloc(&phar_ops, idata, NULL, mode); + idata->phar->refcount++; efree(internal_file); return fpf; } @@ -1011,6 +1012,7 @@ static php_stream * php_stream_phar_url_wrapper(php_stream_wrapper *wrapper, cha idata->internal_file->crc_checked = 1; fpf = php_stream_alloc(&phar_ops, idata, NULL, mode); + idata->phar->refcount++; efree(internal_file); return fpf; } @@ -1029,6 +1031,9 @@ static int phar_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */ data->internal_file->fp = data->fp; } } + if (--data->phar->refcount < 0) { + phar_destroy_phar_data(data->phar TSRMLS_CC); + } efree(data); return 0;