diff options
-rw-r--r-- | libc/misc/dirent/opendir.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libc/misc/dirent/opendir.c b/libc/misc/dirent/opendir.c index 338bef17a..cee703e68 100644 --- a/libc/misc/dirent/opendir.c +++ b/libc/misc/dirent/opendir.c @@ -64,6 +64,7 @@ close_and_ret: if (!(ptr = malloc(sizeof(*ptr)))) goto nomem_close_and_ret; + memset(ptr, '\0', sizeof(DIR)); ptr->dd_fd = fd; ptr->dd_nextloc = ptr->dd_size = ptr->dd_nextoff = 0; |