mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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>
This commit is contained in:
parent
7a42215067
commit
113a421228
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue