nfc_device_new(): replace err() by return

Not a good idea to call exit() from a library...
This commit is contained in:
Philippe Teuwen
2013-03-05 19:57:36 +01:00
parent bece73faaf
commit 09ef2e3927
7 changed files with 37 additions and 1 deletions

View File

@@ -280,6 +280,10 @@ acr122_pcsc_open(const nfc_context *context, const nfc_connstring connstring)
char *pcFirmware;
nfc_device *pnd = nfc_device_new(context, fullconnstring);
if (!pnd) {
perror("malloc");
goto error;
}
pnd->driver_data = malloc(sizeof(struct acr122_pcsc_data));
if (!pnd->driver_data) {
perror("malloc");