From 82873d62c128cb04b4c89fd042042cb7b923e230 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sat, 26 Apr 2014 12:30:29 -0400 Subject: [PATCH] Fixed minor issue. Socket used to find the broadcast ip was not closed when there was more than 16 broadcast interfaces. --- toxcore/LAN_discovery.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c index bed14754..9d1f055e 100644 --- a/toxcore/LAN_discovery.c +++ b/toxcore/LAN_discovery.c @@ -78,8 +78,10 @@ static void fetch_broadcast_info(uint16_t port) struct sockaddr_in *sock4 = (struct sockaddr_in *)&i_faces[i].ifr_broadaddr; - if (broadcast_count >= MAX_INTERFACES) + if (broadcast_count >= MAX_INTERFACES) { + close(sock); return; + } IP_Port *ip_port = &broadcast_ip_port[broadcast_count]; ip_port->ip.family = AF_INET;