From 4da7d0f5dd9c01a3a2fdc08599dd21073e8a36c5 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Fri, 26 Dec 2003 12:00:46 +0000 Subject: [PATCH] Make sure we initialise dirp->dd_size if we aren't reading a unionfs directory. Special thanks to: valgrind --- lib/libc/gen/opendir.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libc/gen/opendir.c b/lib/libc/gen/opendir.c index 3d5c1c5e1eee..3b6f1a0a2f8f 100644 --- a/lib/libc/gen/opendir.c +++ b/lib/libc/gen/opendir.c @@ -258,6 +258,7 @@ __opendir2(name, flags) dirp->dd_size = ddptr - dirp->dd_buf; } else { dirp->dd_len = incr; + dirp->dd_size = 0; dirp->dd_buf = malloc(dirp->dd_len); if (dirp->dd_buf == NULL) goto fail;