Fixed a potential free()ing of a NULL pointer in
authorRyan C. Gordon <icculus@icculus.org>
Thu, 23 Aug 2001 15:06:15 +0000
changeset 67 5000499d4ee2
parent 66 63c02eb30b04
child 68 c9a10b5d5f4f
Fixed a potential free()ing of a NULL pointer in __PHYSFS_platformEnumerateFiles.
platform/unix.c
--- a/platform/unix.c	Thu Aug 23 14:31:00 2001 +0000
+++ b/platform/unix.c	Thu Aug 23 15:06:15 2001 +0000
@@ -403,8 +403,10 @@
         l->next = NULL;
     } /* while */
 
+    if (buf != NULL)
+        free(buf);
+
     closedir(dir);
-    free(buf);
     return(retval);
 } /* __PHYSFS_platformEnumerateFiles */