* libc/posix/opendir.c (opendir): Fix potential memory leak.

This commit is contained in:
Corinna Vinschen 2010-08-25 10:44:47 +00:00
parent 2f1832898f
commit 04c82a9ba0
2 changed files with 5 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/posix/opendir.c (opendir): Fix potential memory leak.
2010-08-10 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* libc/include/sys/dir.h: New BSD-compatibility header.

View File

@ -74,6 +74,7 @@ _DEFUN(opendir, (name),
dirp->dd_len = 512;
if (dirp->dd_buf == NULL) {
free (dirp);
close (fd);
return NULL;
}