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 */