Skip to content

Commit

Permalink
Close socket on error
Browse files Browse the repository at this point in the history
Suggested-by: barry-ran

<#607>
  • Loading branch information
rom1v committed Jun 20, 2019
1 parent bfb3f08 commit 91ecb4f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ connect_and_read_byte(uint16_t port) {
// is not listening, so read one byte to detect a working connection
if (net_recv(socket, &byte, 1) != 1) {
// the server is not listening yet behind the adb tunnel
net_close(socket);
return INVALID_SOCKET;
}
return socket;
Expand Down

0 comments on commit 91ecb4f

Please sign in to comment.