mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Fix memory leak on serial bluetooth
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1533191176
commit
54eefe2f7f
1 changed files with 3 additions and 1 deletions
|
@ -54,8 +54,10 @@ static int qt_serial_open(serial_t **out, dc_context_t *context, const char* dev
|
|||
// Create a RFCOMM socket
|
||||
serial_port->socket = ::socket(AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);
|
||||
|
||||
if (serial_port->socket == INVALID_SOCKET)
|
||||
if (serial_port->socket == INVALID_SOCKET) {
|
||||
free(serial_port);
|
||||
return DC_STATUS_IO;
|
||||
}
|
||||
|
||||
SOCKADDR_BTH socketBthAddress;
|
||||
int socketBthAddressBth = sizeof (socketBthAddress);
|
||||
|
|
Loading…
Reference in a new issue