]> granicus.if.org Git - php/commitdiff
Fixed possible memory leaks.
authorIlia Alshanetsky <iliaa@php.net>
Tue, 15 Oct 2002 02:05:27 +0000 (02:05 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 15 Oct 2002 02:05:27 +0000 (02:05 +0000)
main/user_streams.c

index ac0461320d0a4cef2b0bd6036e99c30d6051bcd5..b411cc7dad81ba72b76dd1826cce46c712661fdf 100644 (file)
@@ -586,6 +586,10 @@ static int php_userstreamop_seek(php_stream *stream, off_t offset, int whence, o
                /* stream_seek is not implemented, so disable seeks for this stream */
                stream->flags |= PHP_STREAM_FLAG_NO_SEEK;
                /* there should be no retval to clean up */
+               
+               if (retval) 
+                       zval_ptr_dtor(&retval);
+               
                return -1;
        } else if (call_result == SUCCESS && retval != NULL && zval_is_true(retval)) {
                ret = 0;
@@ -681,6 +685,10 @@ static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb TSR
                                        us->wrapper->classname);
                }
        }
+       
+       if (retval) 
+               zval_ptr_dtor(&retval);
+       
        return ret;
 }