summaryrefslogtreecommitdiffstats
path: root/lib/netfilter/exp.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-06-10 16:06:37 (GMT)
committerThomas Haller <thaller@redhat.com>2014-06-10 19:45:52 (GMT)
commit90cfeeecac148ca58b066a9c5384cba80ebc3cbb (patch)
treedddd474c7702380ade9e6ad31b2e5d81b56cf549 /lib/netfilter/exp.c
parentd7a9e74f82d136d1e3fa4e174e8b7ba9595ec9a9 (diff)
downloadlibnl-90cfeeecac148ca58b066a9c5384cba80ebc3cbb.zip
libnl-90cfeeecac148ca58b066a9c5384cba80ebc3cbb.tar.gz
libnl-90cfeeecac148ca58b066a9c5384cba80ebc3cbb.tar.bz2
netfilter/ct: fix calling nfnl_*_put() on uninitialized memory after nfnlmsg_*_parse()
nfnlmsg_*_parse() does not assign *result on error. So this will lead to freeing a dangling pointer. Error found by coverity. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib/netfilter/exp.c')
-rw-r--r--lib/netfilter/exp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/netfilter/exp.c b/lib/netfilter/exp.c
index 86ed8d1..9cfdd2b 100644
--- a/lib/netfilter/exp.c
+++ b/lib/netfilter/exp.c
@@ -298,10 +298,9 @@ static int exp_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
int err;
if ((err = nfnlmsg_exp_parse(nlh, &exp)) < 0)
- goto errout;
+ return err;
err = pp->pp_cb((struct nl_object *) exp, pp);
-errout:
nfnl_exp_put(exp);
return err;
}