diff options
author | Mathieu Poirier <mathieu.poirier@linaro.org> | 2014-06-01 21:42:58 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-06-02 04:46:52 -0400 |
commit | 4c552a64dfc2063ef060cf45788cd4250eea3596 (patch) | |
tree | 36552dbf4d62f82ca9cb4e78f97fa13d555cfc21 /net/netfilter | |
parent | 96b2e73c5471542cb9c622c4360716684f8797ed (diff) |
netfilter: nfnetlink_acct: Fix memory leak
Allocation of memory need only to happen once, that is
after the proper checks on the NFACCT_FLAGS have been
done. Otherwise the code can return without freeing
already allocated memory.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nfnetlink_acct.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/net/netfilter/nfnetlink_acct.c b/net/netfilter/nfnetlink_acct.c index 70e86bbb3637..54af9853e2cd 100644 --- a/net/netfilter/nfnetlink_acct.c +++ b/net/netfilter/nfnetlink_acct.c | |||
@@ -83,7 +83,6 @@ nfnl_acct_new(struct sock *nfnl, struct sk_buff *skb, | |||
83 | return -EBUSY; | 83 | return -EBUSY; |
84 | } | 84 | } |
85 | 85 | ||
86 | nfacct = kzalloc(sizeof(struct nf_acct), GFP_KERNEL); | ||
87 | if (tb[NFACCT_FLAGS]) { | 86 | if (tb[NFACCT_FLAGS]) { |
88 | flags = ntohl(nla_get_be32(tb[NFACCT_FLAGS])); | 87 | flags = ntohl(nla_get_be32(tb[NFACCT_FLAGS])); |
89 | if (flags & ~NFACCT_F_QUOTA) | 88 | if (flags & ~NFACCT_F_QUOTA) |