mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-26 18:13:11 +08:00
fix coverity CID 93584
This commit is contained in:
parent
2d5aaaa335
commit
cd965a6d34
1 changed files with 2 additions and 1 deletions
|
@ -1180,12 +1180,14 @@ static int CmdHFiClassDecrypt(const char *Cmd) {
|
||||||
res = loadFile_safe(ICLASS_DECRYPTION_BIN, "", (void **)&keyptr, &keylen);
|
res = loadFile_safe(ICLASS_DECRYPTION_BIN, "", (void **)&keyptr, &keylen);
|
||||||
if (res != PM3_SUCCESS) {
|
if (res != PM3_SUCCESS) {
|
||||||
PrintAndLogEx(INFO, "Couldn't find any decryption methods");
|
PrintAndLogEx(INFO, "Couldn't find any decryption methods");
|
||||||
|
free(decrypted);
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keylen != 16) {
|
if (keylen != 16) {
|
||||||
PrintAndLogEx(ERR, "Failed to load transport key from file");
|
PrintAndLogEx(ERR, "Failed to load transport key from file");
|
||||||
free(keyptr);
|
free(keyptr);
|
||||||
|
free(decrypted);
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
memcpy(key, keyptr, sizeof(key));
|
memcpy(key, keyptr, sizeof(key));
|
||||||
|
@ -1328,7 +1330,6 @@ static int CmdHFiClassDecrypt(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "-----------------------------------------------------------------");
|
PrintAndLogEx(INFO, "-----------------------------------------------------------------");
|
||||||
|
|
||||||
free(decrypted);
|
free(decrypted);
|
||||||
free(fptr);
|
free(fptr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue