From 67a346e4af150bdac5dc8dafeb9fe9fb1e5e3eaf Mon Sep 17 00:00:00 2001
From: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: Mon, 22 Feb 2021 15:24:00 +0100
Subject: [PATCH] Revert "Revert "libeasy: if_utils: fix memory leaks""
This reverts commit 0d14073999a6cbc24423b506091d124c559dd1f7.
---
libeasy/VERSION | 2 +-
libeasy/if_utils.c | 8 +-------
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/libeasy/VERSION b/libeasy/VERSION
index 7ec1d6db..276cbf9e 100644
--- a/libeasy/VERSION
+++ b/libeasy/VERSION
@@ -1 +1 @@
-2.1.0
+2.3.0
diff --git a/libeasy/if_utils.c b/libeasy/if_utils.c
index 7c39f7a2..22d00a8a 100644
--- a/libeasy/if_utils.c
+++ b/libeasy/if_utils.c
@@ -60,13 +60,6 @@ static int if_openlink(const char *ifname, struct nl_sock **s, struct rtnl_link
}
nl_connect(sk, NETLINK_ROUTE);
- link = rtnl_link_alloc();
- if (link == NULL) {
- ret = -errno;
- nl_socket_free(sk);
- return ret;
- }
-
if (rtnl_link_get_kernel(sk, 0, ifname, &link) < 0) {
ret = -1;
goto out;
@@ -282,6 +275,7 @@ int LIBEASY_API if_getaddrs(const char *ifname, struct ip_address *addrs,
naddr = (struct rtnl_addr *)nobj;
}
+ nl_cache_free(res);
out:
if_closelink(sk, link);
--
GitLab