Fixed a crashbug when opening a file that doesn't exist.
This commit is contained in:
parent
f6b15061c8
commit
6a0a1349a8
|
@ -244,7 +244,6 @@ static FileHandle *doOpen(DirHandle *h, const char *name,
|
||||||
char *f = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL);
|
char *f = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL);
|
||||||
void *rc;
|
void *rc;
|
||||||
FileHandle *retval;
|
FileHandle *retval;
|
||||||
char *str;
|
|
||||||
|
|
||||||
BAIL_IF_MACRO(f == NULL, NULL, NULL);
|
BAIL_IF_MACRO(f == NULL, NULL, NULL);
|
||||||
|
|
||||||
|
@ -261,7 +260,7 @@ static FileHandle *doOpen(DirHandle *h, const char *name,
|
||||||
if (!rc)
|
if (!rc)
|
||||||
{
|
{
|
||||||
free(retval);
|
free(retval);
|
||||||
BAIL_MACRO(str, NULL);
|
return(NULL);
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
retval->opaque = (void *) rc;
|
retval->opaque = (void *) rc;
|
||||||
|
|
Loading…
Reference in New Issue