diff options
Diffstat (limited to 'src/libnftables.c')
-rw-r--r-- | src/libnftables.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libnftables.c b/src/libnftables.c index 6fc4f7db..e214abb6 100644 --- a/src/libnftables.c +++ b/src/libnftables.c @@ -607,8 +607,10 @@ err: nft_output_json(&nft->output) && nft_output_echo(&nft->output)) json_print_echo(nft); - if (rc) + + if (rc || nft->check) nft_cache_release(&nft->cache); + return rc; } @@ -713,7 +715,8 @@ err: nft_output_json(&nft->output) && nft_output_echo(&nft->output)) json_print_echo(nft); - if (rc) + + if (rc || nft->check) nft_cache_release(&nft->cache); scope_release(nft->state->scopes[0]); |