summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2019-06-12 09:53:13 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2019-06-12 11:01:33 +0200
commit8322fd6acbbe5d5c937a04e1696512d2889cc2e1 (patch)
treecdecd802e0a60cd04cd7ebf053eeb02db260cdff
parentb35438d27e00ec63d68018268c2733ec14c39e00 (diff)
#896 Fix memory leak in wake_up_broadcast()
call freeifaddrs() after getifaddrs() to release memory.
-rw-r--r--sources/ogAdmServer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/ogAdmServer.cpp b/sources/ogAdmServer.cpp
index 6575edd..d70aa0c 100644
--- a/sources/ogAdmServer.cpp
+++ b/sources/ogAdmServer.cpp
@@ -1287,7 +1287,7 @@ static bool wake_up_broadcast(int sd, struct sockaddr_in *client,
client->sin_addr.s_addr = broadcast_addr->sin_addr.s_addr;
break;
}
- free(ifaddr);
+ freeifaddrs(ifaddr);
ret = sendto(sd, msg, sizeof(*msg), 0,
(sockaddr *)client, sizeof(*client));