]> granicus.if.org Git - php/commitdiff
Plug *half* a leak in context notifiers.
authorSara Golemon <pollita@php.net>
Fri, 27 Jun 2003 03:40:55 +0000 (03:40 +0000)
committerSara Golemon <pollita@php.net>
Fri, 27 Jun 2003 03:40:55 +0000 (03:40 +0000)
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.

main/streams.c

index be017d280c2834b81bfbe63009a35305602f23a4..8ea9f18a872e5f3d2e9b604af2657dae81143193 100755 (executable)
@@ -2823,6 +2823,10 @@ PHPAPI void php_stream_context_free(php_stream_context *context)
                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 @@ PHPAPI php_stream_context *php_stream_context_alloc(void)
        php_stream_context *context;
        
        context = ecalloc(1, sizeof(php_stream_context));
+       context->notifier = NULL;
        MAKE_STD_ZVAL(context->options);
        array_init(context->options);