fix missing tests on malloc() return

This commit is contained in:
Philippe Teuwen 2013-03-18 00:46:31 +01:00
parent 06d5b54308
commit 69c435f348
3 changed files with 17 additions and 0 deletions

View file

@ -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));
}