Skip to content

Commit bf51192

Browse files
author
Ilia Alshanetsky
committed
Fixed possible memory leaks.
1 parent 6890f98 commit bf51192

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

main/user_streams.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,10 @@ static int php_userstreamop_seek(php_stream *stream, off_t offset, int whence, o
586586
/* stream_seek is not implemented, so disable seeks for this stream */
587587
stream->flags |= PHP_STREAM_FLAG_NO_SEEK;
588588
/* there should be no retval to clean up */
589+
590+
if (retval)
591+
zval_ptr_dtor(&retval);
592+
589593
return -1;
590594
} else if (call_result == SUCCESS && retval != NULL && zval_is_true(retval)) {
591595
ret = 0;
@@ -681,6 +685,10 @@ static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb TSR
681685
us->wrapper->classname);
682686
}
683687
}
688+
689+
if (retval)
690+
zval_ptr_dtor(&retval);
691+
684692
return ret;
685693
}
686694

0 commit comments

Comments
 (0)