mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
fix coverity CID 317346
This commit is contained in:
parent
a731bccb01
commit
3e1b041ff8
1 changed files with 3 additions and 1 deletions
|
@ -434,6 +434,7 @@ static int CmdSmartRaw(const char *Cmd) {
|
|||
uint8_t *buf = calloc(PM3_CMD_DATA_SIZE, sizeof(uint8_t));
|
||||
if (buf == NULL) {
|
||||
PrintAndLogEx(DEBUG, "failed to allocate memory");
|
||||
free(payload);
|
||||
return PM3_EMALLOC;
|
||||
}
|
||||
|
||||
|
@ -447,6 +448,7 @@ static int CmdSmartRaw(const char *Cmd) {
|
|||
// reading response from smart card
|
||||
int len = smart_response(buf, PM3_CMD_DATA_SIZE);
|
||||
if (len < 0) {
|
||||
free(payload);
|
||||
free(buf);
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
@ -1140,6 +1142,7 @@ int ExchangeAPDUSC(bool verbose, uint8_t *datain, int datainlen, bool activateCa
|
|||
|
||||
int len = smart_responseEx(dataout, maxdataoutlen, verbose);
|
||||
if (len < 0) {
|
||||
free(payload);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1158,7 +1161,6 @@ int ExchangeAPDUSC(bool verbose, uint8_t *datain, int datainlen, bool activateCa
|
|||
}
|
||||
|
||||
free(payload);
|
||||
|
||||
*dataoutlen = len;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue