nfc_init() return rather than exit on malloc error, examples fixed accordingly
This commit is contained in:
parent
ae6062e5ba
commit
73b5c9d0af
22 changed files with 92 additions and 9 deletions
|
|
@ -174,8 +174,7 @@ nfc_init(nfc_context **context)
|
|||
*context = nfc_context_new();
|
||||
if (!context) {
|
||||
perror("malloc");
|
||||
// TODO: not a good idea to call exit() from a library, we should change API and return error
|
||||
exit(EXIT_FAILURE);
|
||||
return;
|
||||
}
|
||||
if (!nfc_drivers)
|
||||
nfc_drivers_init();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue