mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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)) {
|
if (ftdi_usb_reset(ftdi_ctx)) {
|
||||||
|
free(device);
|
||||||
ERROR (context, "%s", ftdi_get_error_string(ftdi_ctx));
|
ERROR (context, "%s", ftdi_get_error_string(ftdi_ctx));
|
||||||
return DC_STATUS_IO;
|
return DC_STATUS_IO;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue