network: check return value

CID #1349698.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-04-08 21:08:02 -04:00
parent 710a8858a9
commit 0229100b6c
1 changed files with 5 additions and 1 deletions

View 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;