diff --git a/transport/ftdi.c b/transport/ftdi.c index 1444933..52c634a 100644 --- a/transport/ftdi.c +++ b/transport/ftdi.c @@ -286,6 +286,7 @@ transport_t ftdi_open(const char *devpath, if (open_device(tr, dev, baud_rate) < 0) { printc_err("ftdi: failed to open device\n"); + free(tr); return NULL; } diff --git a/transport/rf2500.c b/transport/rf2500.c index a8b56c8..3510edc 100644 --- a/transport/rf2500.c +++ b/transport/rf2500.c @@ -250,6 +250,7 @@ transport_t rf2500_open(const char *devpath, const char *requested_serial) if (open_device(tr, dev) < 0) { printc_err("rf2500: failed to open RF2500 device\n"); + free(tr); return NULL; } diff --git a/transport/ti3410.c b/transport/ti3410.c index 5c17b32..4c057ee 100644 --- a/transport/ti3410.c +++ b/transport/ti3410.c @@ -605,6 +605,7 @@ transport_t ti3410_open(const char *devpath, const char *requested_serial) if (open_device(tr, dev) < 0) { printc_err("ti3410: failed to open TI3410 device\n"); + free(tr); return NULL; }