]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Check return value of ifa_get_local_ip
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 2 Oct 2013 21:18:48 +0000 (17:18 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 2 Oct 2013 21:18:48 +0000 (17:18 -0400)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/network.c

index 1be231d3bc190bd6c4dc9554c6217719ee36d163..09ca8f79c646381402304d24e6367cc391b8e369 100644 (file)
@@ -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;