From 51e7a87468e56f545cc5efe5d3f93d8890b0b26b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Wed, 2 Oct 2013 17:18:48 -0400 Subject: [PATCH] Check return value of ifa_get_local_ip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber Acked-by: Serge Hallyn --- src/lxc/network.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lxc/network.c b/src/lxc/network.c index 1be231d3bc..09ca8f79c6 100644 --- a/src/lxc/network.c +++ b/src/lxc/network.c @@ -882,7 +882,11 @@ static int ip_addr_get(int family, int ifindex, void **res) ip_info = (struct ip_req *)msg; if (ip_info->ifa.ifa_index == ifindex) { - ifa_get_local_ip(family, ip_info, res); + if (ifa_get_local_ip(family, ip_info, res) < 0) { + err = -1; + goto out; + } + /* Found a result, stop searching */ if (*res) goto out;