]> granicus.if.org Git - php/commitdiff
MFH: Fixed a double free bug when freeing persistent streams.
authorIlia Alshanetsky <iliaa@php.net>
Mon, 28 Jul 2003 18:57:49 +0000 (18:57 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 28 Jul 2003 18:57:49 +0000 (18:57 +0000)
main/streams.c

index a549b5924719b7115a7422f429ca827417c86be4..641d057dddb29520d08db0b9a42b8a20946a3ed9 100755 (executable)
@@ -280,7 +280,7 @@ fprintf(stderr, "stream_alloc: %s:%p persistent=%s\n", ops->label, ret, persiste
 
 static int _php_stream_free_persistent(list_entry *le, void *pStream TSRMLS_DC)
 {
-       return le->ptr == pStream;
+       return (le->ptr == pStream && !((php_stream *)pStream)->in_free);
 }
 
 PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC) /* {{{ */