瀏覽代碼

close socket when connect() fails

might be linked to "too many CLI connection" but I'm not sure
Philippe G 4 年之前
父節點
當前提交
75580feaa0
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      components/squeezelite/controls.c

+ 1 - 0
components/squeezelite/controls.c

@@ -279,6 +279,7 @@ static void notify(in_addr_t ip, u16_t hport, u16_t cport) {
 
 	if (connect(cli_sock, (struct sockaddr *) &addr, addrlen) < 0) {
 		LOG_ERROR("unable to connect to server %s:%hu with cli", inet_ntoa(server_ip), server_cport);
+		closesocket(cli_sock);
 		cli_sock = -1;
 	}