self->gz_file = NULL;
}
if (self->stream) {
- php_stream_free(self->stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_PRESERVE_HANDLE);
+ php_stream_close(self->stream);
self->stream = NULL;
}
}
int fd;
if (SUCCESS == php_stream_cast(innerstream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) {
- self->gz_file = gzdopen(fd, mode);
+ self->gz_file = gzdopen(dup(fd), mode);
self->stream = innerstream;
if (self->gz_file) {
stream = php_stream_alloc_rel(&php_stream_gzio_ops, self, 0, mode);
case PHP_STREAM_UNCHANGED:
return stream;
case PHP_STREAM_RELEASED:
+ if (newstream->orig_path) {
+ pefree(newstream->orig_path, persistent);
+ }
newstream->orig_path = pestrdup(path, persistent);
return newstream;
default: