summaryrefslogtreecommitdiff
path: root/toxcore/LAN_discovery.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-04-26 12:30:29 -0400
committerirungentoo <irungentoo@gmail.com>2014-04-26 12:30:29 -0400
commit82873d62c128cb04b4c89fd042042cb7b923e230 (patch)
tree0b5e23458bb6fac31046415cac3b0dbe92877184 /toxcore/LAN_discovery.c
parent09aa97f712f6988ba6cdb041a4708045a574b03b (diff)
Fixed minor issue.
Socket used to find the broadcast ip was not closed when there was more than 16 broadcast interfaces.
Diffstat (limited to 'toxcore/LAN_discovery.c')
-rw-r--r--toxcore/LAN_discovery.c4
1 files changed, 3 insertions, 1 deletions
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)
78 78
79 struct sockaddr_in *sock4 = (struct sockaddr_in *)&i_faces[i].ifr_broadaddr; 79 struct sockaddr_in *sock4 = (struct sockaddr_in *)&i_faces[i].ifr_broadaddr;
80 80
81 if (broadcast_count >= MAX_INTERFACES) 81 if (broadcast_count >= MAX_INTERFACES) {
82 close(sock);
82 return; 83 return;
84 }
83 85
84 IP_Port *ip_port = &broadcast_ip_port[broadcast_count]; 86 IP_Port *ip_port = &broadcast_ip_port[broadcast_count];
85 ip_port->ip.family = AF_INET; 87 ip_port->ip.family = AF_INET;