If netlink_delinearize_obj() fails, it will print an error message. Skip
this object and keep going.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
return 0;
obj = netlink_delinearize_obj(ctx->nlctx, nlo);
- if (!obj)
- return -1;
-
- obj_name = nftnl_obj_get_str(nlo, NFTNL_OBJ_NAME);
- hash = djb_hash(obj_name) % NFT_CACHE_HSIZE;
- cache_add(&obj->cache, &ctx->table->obj_cache, hash);
+ if (obj) {
+ obj_name = nftnl_obj_get_str(nlo, NFTNL_OBJ_NAME);
+ hash = djb_hash(obj_name) % NFT_CACHE_HSIZE;
+ cache_add(&obj->cache, &ctx->table->obj_cache, hash);
+ }
nftnl_obj_list_del(nlo);
nftnl_obj_free(nlo);