diff --git a/gui.pnproj b/gui.pnproj index a67b85a7..600c6a3d 100644 --- a/gui.pnproj +++ b/gui.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/source/banner/openingbnr.c b/source/banner/openingbnr.c index a443fc47..536b781b 100644 --- a/source/banner/openingbnr.c +++ b/source/banner/openingbnr.c @@ -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) diff --git a/source/prompts/DiscBrowser.cpp b/source/prompts/DiscBrowser.cpp index 1cac9626..d047584e 100644 --- a/source/prompts/DiscBrowser.cpp +++ b/source/prompts/DiscBrowser.cpp @@ -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; diff --git a/source/usbloader/getentries.cpp b/source/usbloader/getentries.cpp index d0f7738e..e0d5520f 100644 --- a/source/usbloader/getentries.cpp +++ b/source/usbloader/getentries.cpp @@ -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();