From 8ed7742aa2140e7af50e388d8a2769c2c95d90b4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 4 Jan 2018 13:24:40 +0100 Subject: [PATCH] ip-address-access: let's exit the loop after invalidating our entry a (#7803) CID#1382967 --- src/core/ip-address-access.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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; + } } }