X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/f885043422facc34eb6a5b3c3767f8ac25338157..32da0a464e03b39f894ecfe04cee0da114ff0c9a:/client/cmdlft55xx.c?ds=inline diff --git a/client/cmdlft55xx.c b/client/cmdlft55xx.c index 28149eff..f28f84ce 100644 --- a/client/cmdlft55xx.c +++ b/client/cmdlft55xx.c @@ -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);