From patchwork Thu Mar 8 14:20:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Engelmayer X-Patchwork-Id: 145537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 2965FB6F9D for ; Fri, 9 Mar 2012 01:30:56 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756049Ab2CHOag (ORCPT ); Thu, 8 Mar 2012 09:30:36 -0500 Received: from mail1.frequentis.com ([212.186.194.131]:26179 "EHLO mail1.frequentis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755997Ab2CHOaL (ORCPT ); Thu, 8 Mar 2012 09:30:11 -0500 X-Greylist: delayed 571 seconds by postgrey-1.27 at vger.kernel.org; Thu, 08 Mar 2012 09:30:11 EST X-IronPort-AV: E=Sophos;i="4.73,552,1325458800"; d="scan'208";a="11035249" Received: from vie191nt.frequentis.frq ([172.16.1.191]) by mail1.frequentis.com with ESMTP; 08 Mar 2012 15:20:42 +0100 Received: from frequentis.com (10.16.10.10) by VIE191NT.frequentis.frq (172.16.1.191) with Microsoft SMTP Server id 14.1.355.2; Thu, 8 Mar 2012 15:20:41 +0100 Date: Thu, 8 Mar 2012 15:20:41 +0100 From: Christian Engelmayer To: CC: , Subject: [PATCH] iptables: missing free() in function delete_entry() Message-ID: <20120308152041.7a789c4f@frequentis.com> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) MIME-Version: 1.0 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org From: Franz Flasch Fixed a memory leak in the dry run path of function delete_entry(). Signed-off-by: Franz Flasch Signed-off-by: Christian Engelmayer --- -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- iptables-1.4.12.2/libiptc/libiptc.c 2012-01-02 18:19:09.000000000 +0100 +++ iptables-1.4.12.2-modified/libiptc/libiptc.c 2012-03-08 14:27:24.000000000 +0100 @@ -2001,8 +2001,10 @@ static int delete_entry(const IPT_CHAINL continue; /* if we are just doing a dry run, we simply skip the rest */ - if (dry_run) + if (dry_run){ + free(r); return 1; + } /* If we are about to delete the rule that is the * current iterator, move rule iterator back. next