mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
fix coverity resource leak
This commit is contained in:
parent
ade322a410
commit
13f9972f39
1 changed files with 2 additions and 0 deletions
|
@ -370,12 +370,14 @@ static int generate_config_card(const iclass_config_card_item_t *o, uint8_t *ke
|
||||||
int res_key = loadFile_safe(ICLASS_DECRYPTION_BIN, "", (void **)&keyptr_en, &keylen);
|
int res_key = loadFile_safe(ICLASS_DECRYPTION_BIN, "", (void **)&keyptr_en, &keylen);
|
||||||
if (res_key != PM3_SUCCESS) {
|
if (res_key != PM3_SUCCESS) {
|
||||||
PrintAndLogEx(ERR, "Failed to find iclass_decryptionkey.bin");
|
PrintAndLogEx(ERR, "Failed to find iclass_decryptionkey.bin");
|
||||||
|
free(data);
|
||||||
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_en);
|
free(keyptr_en);
|
||||||
|
free(data);
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
memcpy(key_en, keyptr_en, sizeof(key_en));
|
memcpy(key_en, keyptr_en, sizeof(key_en));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue