summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cache.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cache.c b/src/cache.c
index f7187ee7..4e573676 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -338,6 +338,11 @@ static int cache_init_objects(struct netlink_ctx *ctx, unsigned int flags)
if (!chain)
chain = chain_binding_lookup(table,
rule->handle.chain.name);
+ if (!chain) {
+ ret = -1;
+ goto cache_fails;
+ }
+
list_move_tail(&rule->list, &chain->rules);
}
if (ret < 0) {