Freeing NULL is fine

This commit is contained in:
Peter0x44 2022-04-19 12:09:14 +01:00
parent c52449fd4a
commit ac7ce067d6
No known key found for this signature in database
GPG Key ID: A8DEAD1A4BB82440
3 changed files with 13 additions and 27 deletions

View File

@ -796,11 +796,8 @@ void Menu_WadList(void)
/* Retrieve filelist */
getList:
if (fileList)
{
free (fileList);
fileList = NULL;
}
ret = __Menu_RetrieveList(tmpPath, &fileList, &fileCnt);
if (ret < 0) {

View File

@ -108,7 +108,6 @@ s32 Title_GetList(u64 **outbuf, u32 *outlen)
err:
/* Free memory */
if (titles)
free(titles);
return ret;
@ -144,7 +143,6 @@ s32 Title_GetTicketViews(u64 tid, tikview **outbuf, u32 *outlen)
err:
/* Free memory */
if (views)
free(views);
return ret;
@ -180,7 +178,6 @@ s32 Title_GetTMD(u64 tid, signed_blob **outbuf, u32 *outlen)
err:
/* Free memory */
if (p_tmd)
free(p_tmd);
return ret;
@ -317,7 +314,6 @@ s32 Title_GetIOSVersions(u8 **outbuf, u32 *outlen)
out:
/* Free memory */
if (list)
free(list);
return ret;

View File

@ -239,7 +239,6 @@ s32 __Wad_GetTitleID(FILE *fp, wadHeader *header, u64 *tid)
out:
/* Free memory */
if (p_tik)
free(p_tik);
return ret;
@ -511,15 +510,10 @@ err:
out:
/* Free memory */
if (header)
free(header);
if (p_certs)
free(p_certs);
if (p_crl)
free(p_crl);
if (p_tik)
free(p_tik);
if (p_tmd)
free(p_tmd);
return ret;
@ -671,7 +665,6 @@ s32 Wad_Uninstall(FILE *fp)
out:
/* Free memory */
if (header)
free(header);
return ret;
}