From: Stéphane Graber Date: Wed, 2 Oct 2013 21:18:48 +0000 (-0400) Subject: Check return value of ifa_get_local_ip X-Git-Tag: lxc-1.0.0.alpha2~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51e7a87468e56f545cc5efe5d3f93d8890b0b26b;p=thirdparty%2Flxc.git Check return value of ifa_get_local_ip Signed-off-by: Stéphane Graber Acked-by: Serge Hallyn --- diff --git a/src/lxc/network.c b/src/lxc/network.c index 1be231d3b..09ca8f79c 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;