From 91ecb4f218f9a0f348ed8aee47919d6c2f4779a9 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Thu, 20 Jun 2019 12:15:45 +0200 Subject: [PATCH] Close socket on error Suggested-by: barry-ran --- app/src/server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/server.c b/app/src/server.c index d59394f0..14b8d41d 100644 --- a/app/src/server.c +++ b/app/src/server.c @@ -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;