浏览代码

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>
Mathieu Poirier 11 年之前
父节点
当前提交
4c552a64df
共有 1 个文件被更改,包括 0 次插入1 次删除
  1. 0 1
      net/netfilter/nfnetlink_acct.c

+ 0 - 1
net/netfilter/nfnetlink_acct.c

@@ -83,7 +83,6 @@ nfnl_acct_new(struct sock *nfnl, struct sk_buff *skb,
 		return -EBUSY;
 	}
 
-	nfacct = kzalloc(sizeof(struct nf_acct), GFP_KERNEL);
 	if (tb[NFACCT_FLAGS]) {
 		flags = ntohl(nla_get_be32(tb[NFACCT_FLAGS]));
 		if (flags & ~NFACCT_F_QUOTA)