mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-11 10:38:39 +08:00
fix resource leak
This commit is contained in:
parent
45f98b721c
commit
ae10e76cb5
1 changed files with 4 additions and 2 deletions
|
@ -599,15 +599,17 @@ static int CmdHfLTRestore(const char *Cmd) {
|
|||
uint8_t *dump = NULL;
|
||||
if (loadFile_safe(filename, "", (void**)&dump, &dump_len) == PM3_SUCCESS) {
|
||||
restoreLTO(dump, true);
|
||||
free(dump);
|
||||
}
|
||||
free(dump);
|
||||
|
||||
} else if (str_endswith(lowstr, ".eml")) {
|
||||
|
||||
uint8_t *dump = NULL;
|
||||
if (loadFileEML_safe(filename, (void**)&dump, &dump_len) == PM3_SUCCESS) {
|
||||
restoreLTO(dump, true);
|
||||
free(dump);
|
||||
}
|
||||
free(dump);
|
||||
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "Warning: invalid dump filename " _YELLOW_("%s") " to restore", filename);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue