src/physfs.c
changeset 1683 89e8d39420cd
parent 1660 89e1b79e10c6
child 1692 acdcf93d1f9b
--- a/src/physfs.c	Tue May 12 13:49:46 2020 -0400
+++ b/src/physfs.c	Tue May 12 15:19:01 2020 -0400
@@ -2731,13 +2731,15 @@
                 io->destroy(io);
                 PHYSFS_setErrorCode(PHYSFS_ERR_OUT_OF_MEMORY);
             } /* if */
-
-            memset(fh, '\0', sizeof (FileHandle));
-            fh->io = io;
-            fh->forReading = 1;
-            fh->dirHandle = i;
-            fh->next = openReadList;
-            openReadList = fh;
+            else
+            {
+                memset(fh, '\0', sizeof (FileHandle));
+                fh->io = io;
+                fh->forReading = 1;
+                fh->dirHandle = i;
+                fh->next = openReadList;
+                openReadList = fh;
+            } /* else */
         } /* if */
     } /* if */