diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2015-12-27 14:33:17 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-12-27 21:31:13 -0800 |
commit | 113a421228182698cb77825e3dddaadf1be297c3 (patch) | |
tree | 81603144a5b37bfd3477c72e84c765d9696c1700 /subsurface-core | |
parent | 7a42215067f60edbfeab179343ba0c10b47d9590 (diff) | |
download | subsurface-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.c | 1 |
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; } |