summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-01-04 13:24:40 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-01-04 13:24:40 +0100
commit8ed7742aa2140e7af50e388d8a2769c2c95d90b4 (patch)
treecffb0d00f407f8815489a7824260fb2e9a3cdcd4 /src
parent2fa645f1ccbbed95868b0f25017533c8de2bba2b (diff)
downloadsystemd-8ed7742aa2140e7af50e388d8a2769c2c95d90b4.tar.gz
ip-address-access: let's exit the loop after invalidating our entry a (#7803)
CID#1382967
Diffstat (limited to 'src')
-rw-r--r--src/core/ip-address-access.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/ip-address-access.c b/src/core/ip-address-access.c
index 8d72fc03bf..08bd4c0bce 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;
+ }
}
}