From d2f721866494138c6f2402611a4639c4966fa09c Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Sun, 19 Sep 2004 07:58:13 +0000 Subject: [PATCH] fix a memory leak in win32/dirent.c Original commit message from CVS: fix a memory leak in win32/dirent.c --- ChangeLog | 5 +++++ common | 2 +- win32/dirent.c | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7071c3af62..813047d73e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-19 Steve Lhomme + + * win32/dirent.c: + fix a memory leak + 2004-09-10 Thomas Vander Stichele * configure.ac: diff --git a/common b/common index 5ec931d243..ded6dc5186 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 5ec931d243c53ddda5b2cbb9a2c21ce89747bcb4 +Subproject commit ded6dc5186cb7f8c64cb06a8591b9f787122c6f1 diff --git a/win32/dirent.c b/win32/dirent.c index 74409f6964..d2755b52e5 100644 --- a/win32/dirent.c +++ b/win32/dirent.c @@ -8,6 +8,9 @@ * Updated by Jeremy Bettis * Significantly revised and rewinddir, seekdir and telldir added by Colin * Peters + * + * Resource leaks fixed by + * * * $Revision$ * $Author$ @@ -205,6 +208,9 @@ _tclosedir (_TDIR * dirp) rc = _findclose (dirp->dd_handle); } + if (dirp->dd_dir.d_name) + free (dirp->dd_dir.d_name); + /* Delete the dir structure. */ free (dirp);