cvs: php-src /main/streams transports.c
| From: | Wez Furlong | Date: | Tue, 27 Jan 2004 22:40:45 +0000 |
| Subject: | cvs: php-src /main/streams transports.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-25902@lists.php.net to get a copy of this message | ||
wez Tue Jan 27 17:40:45 2004 EDT
Modified files:
/php-src/main/streams transports.c
Log:
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.
http://cvs.php.net/diff.php/php-src/main/streams/transports.c?r1=1.10&r2=1.11&ty=u
Index: php-src/main/streams/transports.c
diff -u php-src/main/streams/transports.c:1.10 php-src/main/streams/transports.c:1.11
--- php-src/main/streams/transports.c:1.10 Thu Jan 8 03:17:59 2004
+++ php-src/main/streams/transports.c Tue Jan 27 17:40:44 2004
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: transports.c,v 1.10 2004/01/08 08:17:59 andi Exp $ */
+/* $Id: transports.c,v 1.11 2004/01/27 22:40:44 wez Exp $ */
#include "php.h"
#include "php_streams_int.h"
@@ -163,7 +163,11 @@
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;
}