From 0229100b6ccf13247f489da318293f21d2a51b40 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 8 Apr 2016 21:08:02 -0400 Subject: network: check return value CID #1349698. --- src/network/networkd-address-pool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/network/networkd-address-pool.c') diff --git a/src/network/networkd-address-pool.c b/src/network/networkd-address-pool.c index d9d487d805..ebc6c9eb9e 100644 --- a/src/network/networkd-address-pool.c +++ b/src/network/networkd-address-pool.c @@ -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; -- cgit v1.2.3-54-g00ecf