Fixed mishandling of an allocation failure in PHYSFS_openRead().
(Static analysis caught this one! Thanks clang!)
This commit is contained in:
parent
291cad07b7
commit
235e31c420
16
src/physfs.c
16
src/physfs.c
|
@ -2731,13 +2731,15 @@ PHYSFS_File *PHYSFS_openRead(const char *_fname)
|
||||||
io->destroy(io);
|
io->destroy(io);
|
||||||
PHYSFS_setErrorCode(PHYSFS_ERR_OUT_OF_MEMORY);
|
PHYSFS_setErrorCode(PHYSFS_ERR_OUT_OF_MEMORY);
|
||||||
} /* if */
|
} /* if */
|
||||||
|
else
|
||||||
memset(fh, '\0', sizeof (FileHandle));
|
{
|
||||||
fh->io = io;
|
memset(fh, '\0', sizeof (FileHandle));
|
||||||
fh->forReading = 1;
|
fh->io = io;
|
||||||
fh->dirHandle = i;
|
fh->forReading = 1;
|
||||||
fh->next = openReadList;
|
fh->dirHandle = i;
|
||||||
openReadList = fh;
|
fh->next = openReadList;
|
||||||
|
openReadList = fh;
|
||||||
|
} /* else */
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue