pn53x_data_new() now returns null ptr upon malloc() error

This commit is contained in:
Philippe Teuwen
2013-03-18 00:20:49 +01:00
parent af57df532b
commit 06d5b54308
8 changed files with 55 additions and 12 deletions

View File

@@ -264,7 +264,10 @@ acr122_pcsc_open(const nfc_context *context, const nfc_connstring connstring)
}
// Alloc and init chip's data
pn53x_data_new(pnd, &acr122_pcsc_io);
if (pn53x_data_new(pnd, &acr122_pcsc_io) == NULL) {
perror("malloc");
goto error;
}
SCARDCONTEXT *pscc;