From: Greg Beaver Date: Sat, 27 Jan 2007 18:45:48 +0000 (+0000) Subject: fix memleaks and all but 1 test X-Git-Tag: RELEASE_1_0_0RC1~119 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d11c2c4a742c3d2d1b1800303f7754bf3cdd278;p=php fix memleaks and all but 1 test --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index bc1f08135a..e436185410 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -849,7 +849,6 @@ int phar_open_file(php_stream *fp, char *fname, int fname_len, char *alias, int efree(savebuf); if (pphar) { - mydata->refcount++; *pphar = mydata; } diff --git a/ext/phar/tests/open_for_write_existing_b.phpt b/ext/phar/tests/open_for_write_existing_b.phpt index e289a245cb..fbfce79c41 100755 --- a/ext/phar/tests/open_for_write_existing_b.phpt +++ b/ext/phar/tests/open_for_write_existing_b.phpt @@ -32,13 +32,11 @@ include $pname . '/b/c.php'; --CLEAN-- --EXPECTF-- - -Catchable fatal error: fopen(): phar error: file "%sopen_for_write_existing_b.phar.php" cannot opened for writing, disabled by ini setting in %sopen_for_write_existing_b.php on line %d - -Warning: fopen(phar://%sopen_for_write_existing_b.phar.php/b/c.php): failed to open stream: phar error: file "b/c.php" could not be created in phar "%spen_for_write_existing_b.phar.php" in %spen_for_write_existing_b.php on line %d +Warning: fopen(phar://%sopen_for_write_existing_b.phar.php/b/c.php): failed to open stream: phar error: file "%sopen_for_write_existing_b.phar.php" cannot opened for writing, disabled by ini setting +phar error: file "b/c.php" could not be created in phar "%sopen_for_write_existing_b.phar.php" in %sopen_for_write_existing_b.php on line %d Warning: fwrite(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d Warning: fclose(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d This is b/c -===DONE=== +===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/open_for_write_existing_c.phpt b/ext/phar/tests/open_for_write_existing_c.phpt index e6e6333700..1733cea584 100755 --- a/ext/phar/tests/open_for_write_existing_c.phpt +++ b/ext/phar/tests/open_for_write_existing_c.phpt @@ -26,5 +26,11 @@ include $pname . '/b/c.php'; --CLEAN-- --EXPECTF-- +Warning: fopen(phar://%sopen_for_write_existing_c.phar.php/b/c.php): failed to open stream: phar error: file "%sopen_for_write_existing_c.phar.php" cannot opened for writing, disabled by ini setting +phar error: file "b/c.php" could not be created in phar "%sopen_for_write_existing_c.phar.php" in %sopen_for_write_existing_c.php on line %d -Catchable fatal error: fopen(): phar error: file "%sopen_for_write_existing_c.phar.php" cannot opened for writing, disabled by ini setting in %sopen_for_write_existing_c.php on line %d +Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d + +Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d +This is b/c +===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/open_for_write_newfile_b.phpt b/ext/phar/tests/open_for_write_newfile_b.phpt index 86c562f03d..b62158201a 100755 --- a/ext/phar/tests/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/open_for_write_newfile_b.phpt @@ -35,16 +35,15 @@ include $pname . '/b/new.php'; --EXPECTF-- -Catchable fatal error: fopen(): phar error: file "%sopen_for_write_newfile_b.phar.php" cannot opened for writing, disabled by ini setting in %sopen_for_write_newfile_b.php on line %d +Warning: fopen(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: file "%sopen_for_write_newfile_b.phar.php" cannot opened for writing, disabled by ini setting +phar error: file "b/new.php" could not be created in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d -Warning: fopen(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: file "b/new.php" could not be created in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d +Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d -Warning: fwrite()%sresource%sin %sopen_for_write_newfile_b.php on line %d - -Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d +Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line 20 This is b/c -Warning: include(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d +Warning: include(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line 22 Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d diff --git a/ext/phar/tests/open_for_write_newfile_c.phpt b/ext/phar/tests/open_for_write_newfile_c.phpt index dedfada7ce..c4242bdb2e 100755 --- a/ext/phar/tests/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/open_for_write_newfile_c.phpt @@ -28,5 +28,16 @@ include $pname . '/b/new.php'; --CLEAN-- --EXPECTF-- +Warning: fopen(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): failed to open stream: phar error: file "%sopen_for_write_newfile_c.phar.php" cannot opened for writing, disabled by ini setting +phar error: file "b/new.php" could not be created in phar "%sopen_for_write_newfile_c.phar.php" in %sopen_for_write_newfile_c.php on line %d -Catchable fatal error: fopen(): phar error: file "%sopen_for_write_newfile_c.phar.php" cannot opened for writing, disabled by ini setting in %sopen_for_write_newfile_c.php on line %d +Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d + +Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d +This is b/c + +Warning: include(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.php" in %sopen_for_write_newfile_c.php on line %d + +Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d + +===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/phar_oo_compressed_002.phpt b/ext/phar/tests/phar_oo_compressed_002.phpt index c318750a31..a227904982 100755 --- a/ext/phar/tests/phar_oo_compressed_002.phpt +++ b/ext/phar/tests/phar_oo_compressed_002.phpt @@ -4,6 +4,7 @@ Phar: context/compress=GZ --INI-- +phar.readonly=0 phar.require_hash=0 --FILE--