]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: check return value
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 9 Apr 2016 01:08:02 +0000 (21:08 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 9 Apr 2016 01:08:02 +0000 (21:08 -0400)
CID #1349698.

src/network/networkd-address-pool.c

index d9d487d805d31d3988498d6307755ac478f7065b..ebc6c9eb9edb9a2b7749a3d0203a608a767bd85a 100644 (file)
@@ -148,8 +148,12 @@ int address_pool_acquire(AddressPool *p, unsigned prefixlen, union in_addr_union
         for (;;) {
                 if (!address_pool_prefix_is_taken(p, &u, prefixlen)) {
                         _cleanup_free_ char *s = NULL;
+                        int r;
+
+                        r = in_addr_to_string(p->family, &u, &s);
+                        if (r < 0)
+                                return r;
 
-                        in_addr_to_string(p->family, &u, &s);
                         log_debug("Found range %s/%u", strna(s), prefixlen);
 
                         *found = u;