mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-04 18:45:05 +01:00
patch up memory leaks.
issues 1022, 1023, and 1024
This commit is contained in:
parent
981ae17a80
commit
9c7207aa79
File diff suppressed because one or more lines are too long
@ -288,6 +288,7 @@ static int do_U8_archive(void)
|
||||
u8 padding[32];
|
||||
|
||||
if (type != 0x0000) {
|
||||
free(string_table);
|
||||
return -2;
|
||||
}
|
||||
|
||||
@ -295,6 +296,7 @@ static int do_U8_archive(void)
|
||||
int diff = my_data_offset - current_offset;
|
||||
|
||||
if (diff > 32) {
|
||||
free(string_table);
|
||||
return -3;
|
||||
}
|
||||
fread(padding, 1, diff, fp);
|
||||
@ -307,7 +309,9 @@ static int do_U8_archive(void)
|
||||
int result;
|
||||
result = write_imd5_lz77(file_data, size, name);
|
||||
if(result < 0)
|
||||
{free(string_table);
|
||||
return result;
|
||||
}
|
||||
//printf(")\n");
|
||||
current_offset += size;
|
||||
}
|
||||
@ -317,6 +321,7 @@ static int do_U8_archive(void)
|
||||
dir_index--;
|
||||
}
|
||||
}
|
||||
free(string_table);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -399,6 +404,7 @@ void do_U8_archivebanner(FILE *fp)
|
||||
dir_index--;
|
||||
}
|
||||
}
|
||||
free(string_table);
|
||||
}
|
||||
|
||||
int extractbnrfile(const char * filepath, const char * destpath)
|
||||
|
@ -520,7 +520,9 @@ u8 DiscMount(discHdr *header) {
|
||||
|
||||
memcpy(header, g_diskID, 0x60);
|
||||
memcpy(g_diskID, tmpBuff, 0x60); // Put the backup back, or games won't load
|
||||
free(tmpBuff);
|
||||
|
||||
|
||||
ResumeGui();
|
||||
if (dvddone != 1) {
|
||||
return 0;
|
||||
|
@ -286,9 +286,6 @@ int buildTitleList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *PgameC
|
||||
|
||||
ISFS_Initialize();
|
||||
|
||||
sprintf(path,"%s/config/database.txt",bootDevice);
|
||||
f = fopen(path, "r");
|
||||
|
||||
ret = getTitles_TypeCount(typei, &num_titles);
|
||||
if (ret < 0) {
|
||||
return -1;
|
||||
@ -316,6 +313,9 @@ int buildTitleList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *PgameC
|
||||
return -1;
|
||||
|
||||
memset(buffer, 0, len);
|
||||
|
||||
sprintf(path,"%s/config/database.txt",bootDevice);
|
||||
f = fopen(path, "r");
|
||||
|
||||
char name[64];
|
||||
while (i < (num_titles+num_sys_titles)) {
|
||||
@ -404,7 +404,7 @@ int buildTitleList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *PgameC
|
||||
i++;
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
if (f)fclose(f);
|
||||
|
||||
Uninstall_FromTitle(TITLE_ID(1, 0));
|
||||
ISFS_Deinitialize();
|
||||
|
Loading…
Reference in New Issue
Block a user