From: Felipe Pena Date: Sun, 26 Oct 2008 13:22:00 +0000 (+0000) Subject: - Fixed bug #46388 (stream_notification_callback inside of object destroys object... X-Git-Tag: BEFORE_HEAD_NS_CHANGE~160 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=912470c7d8bde0b32e35d7b3ae8b5a438b9eb43d;p=php - Fixed bug #46388 (stream_notification_callback inside of object destroys object variables) --- diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index a10e672a2c..f983a4df59 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -871,12 +871,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_RT_STRING(ps[2], xmsg, ZSTR_AUTOFREE); + ZVAL_RT_STRING(ps[2], xmsg, ZSTR_DUPLICATE); } else { ZVAL_NULL(ps[2]); } @@ -887,6 +888,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); }