diff options
| author | Sara Golemon <pollita@php.net> | 2003-06-27 16:23:58 +0000 |
|---|---|---|
| committer | Sara Golemon <pollita@php.net> | 2003-06-27 16:23:58 +0000 |
| commit | 2e4ef86e10897a0e64500d3aeeaa59d58f8f4f5b (patch) | |
| tree | 1b2f818b85dcaa6b151a68c43498280e0a13ff2f /ext/standard/streamsfuncs.c | |
| parent | ecf58cf8957738451c63a5b7b98b56c4a1c1c521 (diff) | |
| download | php-git-2e4ef86e10897a0e64500d3aeeaa59d58f8f4f5b.tar.gz | |
MFB
Plug leak in context notifiers, implement notifier->dtor
Diffstat (limited to 'ext/standard/streamsfuncs.c')
| -rw-r--r-- | ext/standard/streamsfuncs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index af43d422eb..f0eb73a914 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -631,6 +631,14 @@ static void user_space_stream_notifier(php_stream_context *context, int notifyco } } +static void user_space_stream_notifier_dtor(php_stream_notifier *notifier) +{ + if (notifier && notifier->ptr) { + zval_ptr_dtor((zval **)&(notifier->ptr)); + notifier->ptr = NULL; + } +} + static int parse_context_options(php_stream_context *context, zval *options) { HashPosition pos, opos; @@ -679,6 +687,7 @@ static int parse_context_params(php_stream_context *context, zval *params) context->notifier->func = user_space_stream_notifier; context->notifier->ptr = *tmp; ZVAL_ADDREF(*tmp); + context->notifier->dtor = user_space_stream_notifier_dtor; } if (SUCCESS == zend_hash_find(Z_ARRVAL_P(params), "options", sizeof("options"), (void**)&tmp)) { parse_context_options(context, *tmp); |
