pollita Thu Jun 26 23:40:55 2003 EDT
Modified files: (Branch: PHP_4_3)
/php-src/main streams.c
Log:
Plug *half* a leak in context notifiers.
We still need a check and zval_ptr_dtor(&context->notifier->ptr); in the
php_stream_context_free function, but since ptr is supposed to be a general
purpose container we need to define how that will be done.
Index: php-src/main/streams.c
diff -u php-src/main/streams.c:1.125.2.69 php-src/main/streams.c:1.125.2.70
--- php-src/main/streams.c:1.125.2.69 Thu Jun 26 21:46:30 2003
+++ php-src/main/streams.c Thu Jun 26 23:40:55 2003
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.125.2.69 2003/06/27 01:46:30 pollita Exp $ */
+/* $Id: streams.c,v 1.125.2.70 2003/06/27 03:40:55 pollita Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -2823,6 +2823,10 @@
zval_ptr_dtor(&context->options);
context->options = NULL;
}
+ if (context->notifier) {
+ php_stream_notification_free(context->notifier);
+ context->notifier = NULL;
+ }
efree(context);
}
@@ -2831,6 +2835,7 @@
php_stream_context *context;
context = ecalloc(1, sizeof(php_stream_context));
+ context->notifier = NULL;
MAKE_STD_ZVAL(context->options);
array_init(context->options);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php