mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Merge branch 'stop-wuse-after-free' into 'master'
Stop -Wuse-after-free warnings See merge request STJr/SRB2!1805
This commit is contained in:
commit
892ffbe01b
2 changed files with 3 additions and 3 deletions
|
@ -712,9 +712,9 @@ lumpinfo_t *getdirectoryfiles(const char *path, UINT16 *nlmp, UINT16 *nfolders)
|
|||
// Close any open directories and return if something went wrong.
|
||||
if (failure)
|
||||
{
|
||||
for (; depthleft < maxdirdepth; closedir(dirhandle[depthleft++]));
|
||||
free(dirpathindex);
|
||||
free(dirhandle);
|
||||
for (; depthleft < maxdirdepth; closedir(dirhandle[depthleft++]));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -641,8 +641,6 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
|
|||
lump_p->fullname = Z_Calloc(zentry.namelen + 1, PU_STATIC, NULL);
|
||||
strncpy(lump_p->fullname, fullname, zentry.namelen);
|
||||
|
||||
free(fullname);
|
||||
|
||||
switch(zentry.compression)
|
||||
{
|
||||
case 0:
|
||||
|
@ -662,6 +660,8 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
|
|||
break;
|
||||
}
|
||||
|
||||
free(fullname);
|
||||
|
||||
// skip and ignore comments/extra fields
|
||||
if (fseek(handle, zentry.xtralen + zentry.commlen, SEEK_CUR) != 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue