浏览代码

ip: fixed memory leak

free the interface list before returning from the function
master
Tobias Tschinkowitz 6 年前
committed by Aaron Marcher
父节点
当前提交
1cd8a7b510
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. +1
    -0
      components/ip.c

+ 1
- 0
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;


正在加载...
取消
保存