Skip to content

Commit

Permalink
Fix getaddrinfo memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-fb-martin committed Sep 14, 2020
1 parent 3f05a94 commit 948e158
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions houseportaludp.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ int hp_udp_client (const char *destination, const char *service) {
UdpClient[UdpClientCount++] = s;
if (UdpClientCount >= 16) break;
}
freeaddrinfo(resolved);

return UdpClientCount;
}

Expand Down
2 changes: 2 additions & 0 deletions hp_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ int hp_udp_server (const char *service, int local, int *sockets, int size) {
sockets[count++] = s;
if (count >= size) break;
}
freeaddrinfo(resolved);

return count;
}

Expand Down

0 comments on commit 948e158

Please sign in to comment.