aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/socket.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c
index 82ccfed5..35cce643 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -827,6 +827,7 @@ int osmo_sock_local_ip(char *local_ip, const char *remote_ip)
memset(&local_addr, 0, sizeof(local_addr));
local_addr_len = sizeof(local_addr);
rc = getsockname(sfd, (struct sockaddr *)&local_addr, &local_addr_len);
+ close(sfd);
if (rc < 0)
return -EINVAL;
if (local_addr.sin_family == AF_INET)