diff options
author | Felipe Pena <felipe@php.net> | 2008-10-26 13:25:06 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2008-10-26 13:25:06 +0000 |
commit | 5d804d163ae9774c325c976d401fcab1d87375cb (patch) | |
tree | 9c80005104c64cb0a76ad885ed3a711e6e6eeb68 | |
parent | 0d084028c8edd0fdeffe0ceca31b3b7289de8a66 (diff) | |
download | php-git-5d804d163ae9774c325c976d401fcab1d87375cb.tar.gz |
- MFH: Fixed bug #46388 (stream_notification_callback inside of object destroys object variables)
-rw-r--r-- | ext/standard/streamsfuncs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 8aa8391b12..c3da25259e 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -829,12 +829,13 @@ static void user_space_stream_notifier(php_stream_context *context, int notifyco INIT_ZVAL(zvs[i]); ps[i] = &zvs[i]; ptps[i] = &ps[i]; + MAKE_STD_ZVAL(ps[i]); } ZVAL_LONG(ps[0], notifycode); ZVAL_LONG(ps[1], severity); if (xmsg) { - ZVAL_STRING(ps[2], xmsg, 0); + ZVAL_STRING(ps[2], xmsg, 1); } else { ZVAL_NULL(ps[2]); } @@ -845,6 +846,9 @@ static void user_space_stream_notifier(php_stream_context *context, int notifyco if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, &retval, 6, ptps, 0, NULL TSRMLS_CC)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call user notifier"); } + for (i = 0; i < 6; i++) { + zval_ptr_dtor(&ps[i]); + } if (retval) { zval_ptr_dtor(&retval); } |