projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b640cc4
)
ip: fixed memory leak
author
Tobias Tschinkowitz
<he4d@posteo.de>
Sun, 20 May 2018 13:53:48 +0000
(15:53 +0200)
committer
Aaron Marcher
<me@drkhsh.at>
Sun, 20 May 2018 20:06:54 +0000
(22:06 +0200)
free the interface list before returning from the function
components/ip.c
patch
|
blob
|
history
diff --git
a/components/ip.c
b/components/ip.c
index 0b6293e9e3c746b0886ff428347a37aa52d4bb88..468dc84e2091cc33a8cda79b5d3876ca031371ab 100644
(file)
--- a/
components/ip.c
+++ b/
components/ip.c
@@
-31,6
+31,7
@@
ip(const char *iface, unsigned short sa_family)
host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
if (!strcmp(ifa->ifa_name, iface) &&
(ifa->ifa_addr->sa_family == sa_family)) {
+ freeifaddrs(ifaddr);
if (s != 0) {
warn("getnameinfo: %s", gai_strerror(s));
return NULL;