mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07: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;
|
uint8_t *dump = NULL;
|
||||||
if (loadFile_safe(filename, "", (void**)&dump, &dump_len) == PM3_SUCCESS) {
|
if (loadFile_safe(filename, "", (void**)&dump, &dump_len) == PM3_SUCCESS) {
|
||||||
restoreLTO(dump, true);
|
restoreLTO(dump, true);
|
||||||
free(dump);
|
|
||||||
}
|
}
|
||||||
|
free(dump);
|
||||||
|
|
||||||
} else if (str_endswith(lowstr, ".eml")) {
|
} else if (str_endswith(lowstr, ".eml")) {
|
||||||
|
|
||||||
uint8_t *dump = NULL;
|
uint8_t *dump = NULL;
|
||||||
if (loadFileEML_safe(filename, (void**)&dump, &dump_len) == PM3_SUCCESS) {
|
if (loadFileEML_safe(filename, (void**)&dump, &dump_len) == PM3_SUCCESS) {
|
||||||
restoreLTO(dump, true);
|
restoreLTO(dump, true);
|
||||||
free(dump);
|
|
||||||
}
|
}
|
||||||
|
free(dump);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(WARNING, "Warning: invalid dump filename " _YELLOW_("%s") " to restore", filename);
|
PrintAndLogEx(WARNING, "Warning: invalid dump filename " _YELLOW_("%s") " to restore", filename);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue