cvs: php4 /main/streams streams.c

From: Date: Wed, 16 Apr 2003 17:30:03 +0000
Subject: cvs: php4 /main/streams streams.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-20325@lists.php.net to get a copy of this message
helly Wed Apr 16 13:30:03 2003 EDT Modified files: /php4/main/streams streams.c Log: Don't access what is already freed (noticed by Sascha) Index: php4/main/streams/streams.c diff -u php4/main/streams/streams.c:1.20 php4/main/streams/streams.c:1.21 --- php4/main/streams/streams.c:1.20 Sun Apr 13 16:30:57 2003 +++ php4/main/streams/streams.c Wed Apr 16 13:30:03 2003 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streams.c,v 1.20 2003/04/13 20:30:57 helly Exp $ */ +/* $Id: streams.c,v 1.21 2003/04/16 17:30:03 helly Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -317,6 +317,7 @@ } 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 @@ #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); }

« previous php.cvs (#20325) next »