mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 20:31:30 +00:00
Fix uninitialized pointer.
Signed-off-by: Nev3r <apophycens@gmail.com>
This commit is contained in:
parent
3f69e7c9b4
commit
ec67c4cbd6
1 changed files with 7 additions and 7 deletions
14
src/w_wad.c
14
src/w_wad.c
|
@ -369,7 +369,7 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen
|
|||
if (fread(&header, 1, sizeof header, handle) < sizeof header)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Can't read wad header because %s\n"), strerror(ferror(handle)));
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (memcmp(header.identification, "ZWAD", 4) == 0)
|
||||
|
@ -379,7 +379,7 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen
|
|||
&& memcmp(header.identification, "SDLL", 4) != 0)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Invalid WAD header\n"));
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
header.numlumps = LONG(header.numlumps);
|
||||
|
@ -393,7 +393,7 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen
|
|||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Corrupt wadfile directory (%s)\n"), strerror(ferror(handle)));
|
||||
free(fileinfov);
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
numlumps = header.numlumps;
|
||||
|
@ -538,7 +538,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
|
|||
if (!ResFindSignature(handle, pat_end, max(0, ftell(handle) - (22 + 65536))))
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "Missing central directory\n");
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fseek(handle, -4, SEEK_CUR);
|
||||
|
@ -561,7 +561,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
|
|||
CONS_Alert(CONS_ERROR, "Central directory is corrupt\n");
|
||||
Z_Free(lumpinfo);
|
||||
free(zentry);
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
lump_p->position = zentry->offset + zentry->namelen + zentry->xtralen + sizeof(zlentry_t);
|
||||
|
@ -624,7 +624,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
|
|||
UINT16 W_InitFile(const char *filename)
|
||||
{
|
||||
FILE *handle;
|
||||
lumpinfo_t *lumpinfo;
|
||||
lumpinfo_t *lumpinfo = NULL;
|
||||
wadfile_t *wadfile;
|
||||
restype_t type;
|
||||
UINT16 numlumps = 0;
|
||||
|
@ -709,7 +709,7 @@ UINT16 W_InitFile(const char *filename)
|
|||
CONS_Alert(CONS_ERROR, "Unsupported file format\n");
|
||||
}
|
||||
|
||||
if (lumpinfo == 0)
|
||||
if (lumpinfo == NULL)
|
||||
{
|
||||
fclose(handle);
|
||||
return INT16_MAX;
|
||||
|
|
Loading…
Reference in a new issue