mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-05-28 16:16:21 +00:00
uart drivers: missing pn53x_data_free() on some error handling branches
This commit is contained in:
@@ -141,6 +141,7 @@ arygon_scan(const nfc_context *context, nfc_connstring connstrings[], const size
|
|||||||
// pipe-based abort mecanism
|
// pipe-based abort mecanism
|
||||||
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
|
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
|
||||||
uart_close(DRIVER_DATA(pnd)->port);
|
uart_close(DRIVER_DATA(pnd)->port);
|
||||||
|
pn53x_data_free(pnd);
|
||||||
nfc_device_free(pnd);
|
nfc_device_free(pnd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -271,6 +272,7 @@ arygon_open(const nfc_context *context, const nfc_connstring connstring)
|
|||||||
// pipe-based abort mecanism
|
// pipe-based abort mecanism
|
||||||
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
|
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
|
||||||
uart_close(DRIVER_DATA(pnd)->port);
|
uart_close(DRIVER_DATA(pnd)->port);
|
||||||
|
pn53x_data_free(pnd);
|
||||||
nfc_device_free(pnd);
|
nfc_device_free(pnd);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ pn532_uart_scan(const nfc_context *context, nfc_connstring connstrings[], const
|
|||||||
// pipe-based abort mecanism
|
// pipe-based abort mecanism
|
||||||
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
|
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
|
||||||
uart_close(DRIVER_DATA(pnd)->port);
|
uart_close(DRIVER_DATA(pnd)->port);
|
||||||
|
pn53x_data_free(pnd);
|
||||||
nfc_device_free(pnd);
|
nfc_device_free(pnd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -244,6 +245,7 @@ pn532_uart_open(const nfc_context *context, const nfc_connstring connstring)
|
|||||||
// pipe-based abort mecanism
|
// pipe-based abort mecanism
|
||||||
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
|
if (pipe(DRIVER_DATA(pnd)->iAbortFds) < 0) {
|
||||||
uart_close(DRIVER_DATA(pnd)->port);
|
uart_close(DRIVER_DATA(pnd)->port);
|
||||||
|
pn53x_data_free(pnd);
|
||||||
nfc_device_free(pnd);
|
nfc_device_free(pnd);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user