Fix memory leak

This commit is contained in:
retro-wertz
2019-01-04 19:33:26 +08:00
parent b53fb91239
commit 00bf47ebf8

View File

@@ -665,11 +665,13 @@ int FDSLoad(const char *name, FCEUFILE *fp) {
if (FDSBIOS)
free(FDSBIOS);
FDSBIOS = NULL;
free(zp->fp->data);
FCEU_fclose(zp);
FCEU_PrintError("Error reading FDS BIOS ROM image.\n");
return 0;
}
free(zp->fp->data);
FCEU_fclose(zp);
FCEU_fseek(fp, 0, SEEK_SET);