diff options
author | Marcus Boerger <helly@php.net> | 2003-04-16 17:30:03 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-04-16 17:30:03 +0000 |
commit | b09aa87120e0c4fceb2514d4416b96304fc71b42 (patch) | |
tree | 25dbfe2dabd3e27fe9d533b6be8bfbf60e10a3f4 | |
parent | 2a31fa0569b138fefb0c3b70cd669618bff87ba7 (diff) | |
download | php-git-b09aa87120e0c4fceb2514d4416b96304fc71b42.tar.gz |
Don't access what is already freed (noticed by Sascha)
-rwxr-xr-x | main/streams/streams.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c index a5e742dd7c..286f8a6452 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -317,6 +317,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov } if (close_options & PHP_STREAM_FREE_RELEASE_STREAM) { + int was_persistent = stream->is_persistent; while (stream->readfilters.head) { php_stream_filter_remove(stream->readfilters.head, 1 TSRMLS_CC); @@ -369,7 +370,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov #else pefree(stream, stream->is_persistent); #endif - if (stream->is_persistent) { + if (was_persistent) { /* we don't work with *stream but need its value for comparison */ zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) _php_stream_free_persistent, stream TSRMLS_CC); } |