* libc/posix/opendir.c (opendir): Fix potential memory leak.
This commit is contained in:
parent
2f1832898f
commit
04c82a9ba0
|
@ -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>
|
2010-08-10 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
|
||||||
|
|
||||||
* libc/include/sys/dir.h: New BSD-compatibility header.
|
* libc/include/sys/dir.h: New BSD-compatibility header.
|
||||||
|
|
|
@ -74,6 +74,7 @@ _DEFUN(opendir, (name),
|
||||||
dirp->dd_len = 512;
|
dirp->dd_len = 512;
|
||||||
|
|
||||||
if (dirp->dd_buf == NULL) {
|
if (dirp->dd_buf == NULL) {
|
||||||
|
free (dirp);
|
||||||
close (fd);
|
close (fd);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue