diff options
Diffstat (limited to 'main/user_streams.c')
-rw-r--r-- | main/user_streams.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/main/user_streams.c b/main/user_streams.c index 9ee823f3df..ac0461320d 100644 --- a/main/user_streams.c +++ b/main/user_streams.c @@ -464,8 +464,10 @@ static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count } zval_ptr_dtor(&zcount); - if (retval) + if (retval) { zval_ptr_dtor(&retval); + retval = NULL; + } /* since the user stream has no way of setting the eof flag directly, we need to ask it if we hit eof */ @@ -487,6 +489,11 @@ static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count stream->eof = 1; } + if (retval) { + zval_ptr_dtor(&retval); + retval = NULL; + } + return didread; } @@ -586,8 +593,10 @@ static int php_userstreamop_seek(php_stream *stream, off_t offset, int whence, o ret = -1; } - if (retval) + if (retval) { zval_ptr_dtor(&retval); + retval = NULL; + } /* now determine where we are */ ZVAL_STRINGL(&func_name, USERSTREAM_TELL, sizeof(USERSTREAM_TELL)-1, 0); @@ -603,10 +612,10 @@ static int php_userstreamop_seek(php_stream *stream, off_t offset, int whence, o else php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_TELL " is not implemented!", us->wrapper->classname); - + if (retval) zval_ptr_dtor(&retval); - + return 0; } |