Explorar el Código

Fixed a potential free()ing of a NULL pointer in
__PHYSFS_platformEnumerateFiles.

Ryan C. Gordon hace 24 años
padre
commit
e6bebfa32c
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      platform/unix.c

+ 3 - 1
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 */