CHG: "hf mf hardnested" - less printing

CHG: some filehandles = NULL.
This commit is contained in:
iceman1001 2016-10-21 16:06:53 +02:00
commit 2dcf60f3df
15 changed files with 112 additions and 61 deletions

View file

@ -1491,7 +1491,10 @@ int CmdT55xxBruteForce(const char *Cmd) {
if (!p) {
PrintAndLog("Cannot allocate memory for defaultKeys");
free(keyBlock);
fclose(f);
if (f) {
fclose(f);
f = NULL;
}
return 2;
}
keyBlock = p;
@ -1502,8 +1505,10 @@ int CmdT55xxBruteForce(const char *Cmd) {
keycnt++;
memset(buf, 0, sizeof(buf));
}
fclose(f);
if (f) {
fclose(f);
f = NULL;
}
if (keycnt == 0) {
PrintAndLog("No keys found in file");
free(keyBlock);