]> granicus.if.org Git - php/commitdiff
Ensure that all fields are initialized to NULL.
authorWez Furlong <wez@php.net>
Sat, 1 Mar 2003 17:27:23 +0000 (17:27 +0000)
committerWez Furlong <wez@php.net>
Sat, 1 Mar 2003 17:27:23 +0000 (17:27 +0000)
main/streams/plain_wrapper.c

index ce2a7a553d0a6ecb4a3ca27f94da1c40e613bdd2..b8fd2cd0f4d059d0414fb2b80f7b158b7844195a 100644 (file)
@@ -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;