aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-core
diff options
context:
space:
mode:
authorGravatar Stephen Hemminger <stephen@networkplumber.org>2015-12-27 14:33:17 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-27 21:31:13 -0800
commit113a421228182698cb77825e3dddaadf1be297c3 (patch)
tree81603144a5b37bfd3477c72e84c765d9696c1700 /subsurface-core
parent7a42215067f60edbfeab179343ba0c10b47d9590 (diff)
downloadsubsurface-113a421228182698cb77825e3dddaadf1be297c3.tar.gz
ftdi: fix memory leak on error
Found by cppcheck. Minor memory leak if usb_reset fails Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core')
-rw-r--r--subsurface-core/serial_ftdi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/subsurface-core/serial_ftdi.c b/subsurface-core/serial_ftdi.c
index cbac026cf..ff1335171 100644
--- a/subsurface-core/serial_ftdi.c
+++ b/subsurface-core/serial_ftdi.c
@@ -218,6 +218,7 @@ static dc_status_t serial_ftdi_open (serial_t **out, dc_context_t *context, cons
}
if (ftdi_usb_reset(ftdi_ctx)) {
+ free(device);
ERROR (context, "%s", ftdi_get_error_string(ftdi_ctx));
return DC_STATUS_IO;
}