This commit is contained in:
twinaphex 2016-01-25 01:17:18 +01:00
parent 7bc6a0a333
commit 0c87b100ea

View File

@ -101,8 +101,6 @@ static int read_7zip_file(
ISzAlloc allocImp; ISzAlloc allocImp;
ISzAlloc allocTempImp; ISzAlloc allocTempImp;
uint8_t *output = 0; uint8_t *output = 0;
size_t output_size = 0;
uint16_t *temp = NULL;
long outsize = -1; long outsize = -1;
/*These are the allocation routines. /*These are the allocation routines.
@ -129,6 +127,7 @@ static int read_7zip_file(
{ {
uint32_t i; uint32_t i;
bool file_found = false; bool file_found = false;
uint16_t *temp = NULL;
size_t temp_size = 0; size_t temp_size = 0;
uint32_t block_index = 0xFFFFFFFF; uint32_t block_index = 0xFFFFFFFF;
SRes res = SZ_OK; SRes res = SZ_OK;
@ -166,6 +165,8 @@ static int read_7zip_file(
if (string_is_equal(infile, needle)) if (string_is_equal(infile, needle))
{ {
size_t output_size = 0;
RARCH_LOG_OUTPUT("Opened archive %s. Now trying to extract %s\n", RARCH_LOG_OUTPUT("Opened archive %s. Now trying to extract %s\n",
path, needle); path, needle);
@ -193,7 +194,6 @@ static int read_7zip_file(
res = SZ_OK; res = SZ_OK;
file_found = true; file_found = true;
outsize = -1; outsize = -1;
break;
} }
} }
else else
@ -211,6 +211,9 @@ static int read_7zip_file(
} }
} }
free(temp);
IAlloc_Free(&allocImp, output);
if (!(file_found && res == SZ_OK)) if (!(file_found && res == SZ_OK))
{ {
/* Error handling */ /* Error handling */
@ -223,9 +226,7 @@ static int read_7zip_file(
} }
} }
IAlloc_Free(&allocImp, output);
SzArEx_Free(&db, &allocImp); SzArEx_Free(&db, &allocImp);
free(temp);
File_Close(&archiveStream.file); File_Close(&archiveStream.file);
return outsize; return outsize;