fix resource leak

This commit is contained in:
iceman1001 2020-06-07 19:25:56 +02:00
parent 45f98b721c
commit ae10e76cb5

View file

@ -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);
}