diff options
author | Wez Furlong <wez@php.net> | 2004-01-27 22:40:44 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2004-01-27 22:40:44 +0000 |
commit | e1ae61802baa651cf4398c13d74b51cb58f57774 (patch) | |
tree | 7f5bdbfd38322b7cc1e69e6279ec13baa525fa88 | |
parent | 4af9e35316c016142fe40d8e9a12b2eae157e5ed (diff) | |
download | php-git-e1ae61802baa651cf4398c13d74b51cb58f57774.tar.gz |
Fix segfault for scripts like this:
<?php
pfsockopen("foo");
pfsockopen("foo");
?>
Where the transport fails to connect (since args are bogus);
the problem was that the persistent stream entry was not
correctly freed.
-rw-r--r-- | main/streams/transports.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; } |