From: Wez Furlong Date: Tue, 27 Jan 2004 22:40:44 +0000 (+0000) Subject: Fix segfault for scripts like this: X-Git-Tag: php-5.0.0b4RC1~272 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1ae61802baa651cf4398c13d74b51cb58f57774;p=php Fix segfault for scripts like this: Where the transport fails to connect (since args are bogus); the problem was that the persistent stream entry was not correctly freed. --- diff --git a/main/streams/transports.c b/main/streams/transports.c index 5b2c0d89bb..1c20026655 100644 --- a/main/streams/transports.c +++ b/main/streams/transports.c @@ -163,7 +163,11 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, long namelen, int if (failed) { /* failure means that they don't get a stream to play with */ - php_stream_close(stream); + if (persistent_id) { + php_stream_pclose(stream); + } else { + php_stream_close(stream); + } stream = NULL; }