From 04c82a9ba057783e291f64049508ae5810c9f951 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 25 Aug 2010 10:44:47 +0000 Subject: * libc/posix/opendir.c (opendir): Fix potential memory leak. --- newlib/ChangeLog | 4 ++++ newlib/libc/posix/opendir.c | 1 + 2 files changed, 5 insertions(+) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 78732cf..00cc126 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2010-08-25 Sebastian Huber + + * libc/posix/opendir.c (opendir): Fix potential memory leak. + 2010-08-10 Yaakov Selkowitz * libc/include/sys/dir.h: New BSD-compatibility header. diff --git a/newlib/libc/posix/opendir.c b/newlib/libc/posix/opendir.c index c9a97db..ca764e1 100644 --- a/newlib/libc/posix/opendir.c +++ b/newlib/libc/posix/opendir.c @@ -74,6 +74,7 @@ _DEFUN(opendir, (name), dirp->dd_len = 512; if (dirp->dd_buf == NULL) { + free (dirp); close (fd); return NULL; } -- cgit v1.1