From: Lennart Poettering Date: Thu, 4 Jan 2018 12:24:40 +0000 (+0100) Subject: ip-address-access: let's exit the loop after invalidating our entry a (#7803) X-Git-Tag: v237~149 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8ed7742aa2140e7af50e388d8a2769c2c95d90b4;p=thirdparty%2Fsystemd.git ip-address-access: let's exit the loop after invalidating our entry a (#7803) CID#1382967 --- diff --git a/src/core/ip-address-access.c b/src/core/ip-address-access.c index 8d72fc03bf7..08bd4c0bce1 100644 --- a/src/core/ip-address-access.c +++ b/src/core/ip-address-access.c @@ -210,13 +210,12 @@ IPAddressAccessItem* ip_address_access_reduce(IPAddressAccessItem *first) { &b->address, b->prefixlen, &a->address); - if (r <= 0) - continue; - - /* b covers a fully, then let's drop a */ - - LIST_REMOVE(items, first, a); - free(a); + if (r > 0) { + /* b covers a fully, then let's drop a */ + LIST_REMOVE(items, first, a); + free(a); + break; + } } }