From patchwork Thu Oct 16 09:19:25 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 4668 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 84711DE19E for ; Thu, 16 Oct 2008 20:19:33 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754041AbYJPJT3 (ORCPT ); Thu, 16 Oct 2008 05:19:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753904AbYJPJT2 (ORCPT ); Thu, 16 Oct 2008 05:19:28 -0400 Received: from courier.cs.helsinki.fi ([128.214.9.1]:33554 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752710AbYJPJT2 (ORCPT ); Thu, 16 Oct 2008 05:19:28 -0400 Received: from wrl-59.cs.helsinki.fi (wrl-59.cs.helsinki.fi [128.214.166.179]) (AUTH: PLAIN cs-relay, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mail.cs.helsinki.fi with esmtp; Thu, 16 Oct 2008 12:19:26 +0300 id 0005BF7B.48F7071E.00000FEE Received: by wrl-59.cs.helsinki.fi (Postfix, from userid 50795) id 29200A009F; Thu, 16 Oct 2008 12:19:26 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by wrl-59.cs.helsinki.fi (Postfix) with ESMTP id 17C1CA0098; Thu, 16 Oct 2008 12:19:25 +0300 (EEST) Date: Thu, 16 Oct 2008 12:19:25 +0300 (EEST) From: "=?ISO-8859-1?Q?Ilpo_J=E4rvinen?=" X-X-Sender: ijjarvin@wrl-59.cs.helsinki.fi To: David Miller cc: Patrick Hardy , Netdev Subject: [PATCH] netfilter/ipv4: snmp nat leaks memory in case of failure Message-ID: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Ilpo Järvinen --- net/ipv4/netfilter/nf_nat_snmp_basic.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c index ffeaffc..8303e4b 100644 --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c @@ -742,6 +742,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); if (*obj == NULL) { + kfree(p); kfree(id); if (net_ratelimit()) printk("OOM in bsalg (%d)\n", __LINE__);