From c3e6bcd398f09d6b25695113a4a1df27cda4b17e Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 1 Mar 2003 17:27:23 +0000 Subject: [PATCH] Ensure that all fields are initialized to NULL. --- main/streams/plain_wrapper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index ce2a7a553d..b8fd2cd0f4 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -203,6 +203,7 @@ PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode STREAMS_DC php_stream *stream; self = emalloc_rel_orig(sizeof(*self)); + memset(self, 0, sizeof(*self)); self->file = NULL; self->is_pipe = 0; self->lock_flag = LOCK_UN; @@ -246,6 +247,7 @@ PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STRE php_stream *stream; self = emalloc_rel_orig(sizeof(*self)); + memset(self, 0, sizeof(*self)); self->file = file; self->is_pipe = 0; self->lock_flag = LOCK_UN; @@ -289,6 +291,7 @@ PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STRE php_stream *stream; self = emalloc_rel_orig(sizeof(*self)); + memset(self, 0, sizeof(*self)); self->file = file; self->is_pipe = 1; self->lock_flag = LOCK_UN; -- 2.50.1