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.
This commit is contained in:
Wez Furlong 2004-01-27 22:40:44 +00:00
parent 4af9e35316
commit e1ae61802b

View File

@ -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;
}