if genid changes during cache_init(), check_genid() sets errno to EINTR to force
a re-init of the cache.
cache_release() may inadvertly change errno by calling free(). Indeed free()
may invoke madvise() that changes errno to ENOSYS on system where kernel is
configured without support for this syscall.
Signed-off-by: Marco Oliverio <marco.oliverio@tanaza.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
ret = nft_cache_init(&ctx, flags);
if (ret < 0) {
- nft_cache_release(cache);
- if (errno == EINTR)
+ if (errno == EINTR) {
+ nft_cache_release(cache);
goto replay;
+ }
+ nft_cache_release(cache);
return -1;
}