diff options
-rw-r--r-- | gdbstub.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2762,11 +2762,13 @@ static int gdbserver_open(int port) ret = bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)); if (ret < 0) { perror("bind"); + close(fd); return -1; } ret = listen(fd, 0); if (ret < 0) { perror("listen"); + close(fd); return -1; } return fd; |