Re: [PATCH 2/3 libnftnl] fix some error checking in parser functions

2016-06-16 Thread Pablo Neira Ayuso
On Thu, Jun 16, 2016 at 12:20:11PM +0200, Carlos Falgueras García wrote: > diff --git a/src/rule.c b/src/rule.c > index b009c37..930ecc0 100644 > --- a/src/rule.c > +++ b/src/rule.c > @@ -427,7 +427,7 @@ int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, > struct nftnl_rule *r) > { > st

[PATCH 2/3 libnftnl] fix some error checking in parser functions

2016-06-16 Thread Carlos Falgueras García
Use a variable 'ret' multiple times without treat the error between can overwrite the previous error value, and may execute code which should not. Bad way: int f() { int ret; ret = g(); ret = h(); return ret; } Good