From e6bebfa32c0df7f5dd7ad9c8ba54ea1a7149da0c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 23 Aug 2001 15:06:15 +0000 Subject: [PATCH] Fixed a potential free()ing of a NULL pointer in __PHYSFS_platformEnumerateFiles. --- platform/unix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/unix.c b/platform/unix.c index 42bed07..7d321e9 100644 --- a/platform/unix.c +++ b/platform/unix.c @@ -403,8 +403,10 @@ LinkedStringList *__PHYSFS_platformEnumerateFiles(const char *dirname, l->next = NULL; } /* while */ + if (buf != NULL) + free(buf); + closedir(dir); - free(buf); return(retval); } /* __PHYSFS_platformEnumerateFiles */