e sys l2ping - close socket fd on error to be clean

fix CID 1403954
This commit is contained in:
Carsten Haitzler 2019-08-06 12:54:28 +01:00
parent bb390716f5
commit ccd0da5f02
1 changed files with 1 additions and 0 deletions

View File

@ -45,6 +45,7 @@ e_sys_l2ping(const char *bluetooth_mac, int timeout_ms)
if (bind(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
{
perror("Can't bind socket");
close(fd);
return -1;
}