Преглед на файлове

Bugfix for infinite loop/touching free()'d memory during PHYSFS_deinit().

Ryan C. Gordon преди 25 години
родител
ревизия
2827a86e87
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      physfs.c

+ 2 - 2
physfs.c

@@ -152,7 +152,7 @@ static void freeErrorMessages(void)
 
 
     for (i = errorMessages; i != NULL; i = next)
     for (i = errorMessages; i != NULL; i = next)
     {
     {
-        next = i;
+        next = i->next;
         free(i);
         free(i);
     } /* for */
     } /* for */
 } /* freeErrorMessages */
 } /* freeErrorMessages */
@@ -414,7 +414,7 @@ static void freeSearchPath(void)
     {
     {
         for (i = searchPath; i != NULL; i = next)
         for (i = searchPath; i != NULL; i = next)
         {
         {
-            next = i;
+            next = i->next;
             freeDirInfo(i, openReadList);
             freeDirInfo(i, openReadList);
         } /* for */
         } /* for */
         searchPath = NULL;
         searchPath = NULL;