fix missing tests on malloc() return
This commit is contained in:
parent
06d5b54308
commit
69c435f348
3 changed files with 17 additions and 0 deletions
|
|
@ -3097,6 +3097,7 @@ pn53x_current_target_new(const struct nfc_device *pnd, const nfc_target *pnt)
|
|||
free(CHIP_DATA(pnd)->current_target);
|
||||
}
|
||||
CHIP_DATA(pnd)->current_target = malloc(sizeof(nfc_target));
|
||||
// TODO: test malloc
|
||||
memcpy(CHIP_DATA(pnd)->current_target, pnt, sizeof(nfc_target));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue