mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
fix: mem leaks.
This commit is contained in:
parent
06ade9970a
commit
91d6836a47
7 changed files with 22 additions and 14 deletions
|
@ -266,14 +266,20 @@ static void init_bitflip_bitarrays(void)
|
|||
continue;
|
||||
} else {
|
||||
fseek(statesfile, 0, SEEK_END);
|
||||
uint32_t filesize = (uint32_t)ftell(statesfile);
|
||||
int fsize = ftell(statesfile);
|
||||
if ( fsize == -1 ){
|
||||
PrintAndLogEx(WARNING, "File read error with %s. Aborting...\n", state_file_name);
|
||||
fclose(statesfile);
|
||||
exit(5);
|
||||
}
|
||||
uint32_t filesize = (uint32_t)fsize;
|
||||
rewind(statesfile);
|
||||
uint8_t input_buffer[filesize];
|
||||
size_t bytesread = fread(input_buffer, 1, filesize, statesfile);
|
||||
if (bytesread != filesize) {
|
||||
PrintAndLogEx(WARNING, "File read error with %s. Aborting...\n", state_file_name);
|
||||
fclose(statesfile);
|
||||
inflateEnd(&compressed_stream);
|
||||
//inflateEnd(&compressed_stream);
|
||||
exit(5);
|
||||
}
|
||||
fclose(statesfile);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue