From patchwork Sat Jun 8 12:24:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuseppe Longo X-Patchwork-Id: 249948 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 C6D1B2C0092 for ; Sat, 8 Jun 2013 22:24:59 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751699Ab3FHMYt (ORCPT ); Sat, 8 Jun 2013 08:24:49 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:56347 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751628Ab3FHMYt (ORCPT ); Sat, 8 Jun 2013 08:24:49 -0400 Received: by mail-wg0-f44.google.com with SMTP id m15so2700759wgh.11 for ; Sat, 08 Jun 2013 05:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:from:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=jQDQkv5V/tUeYYa0XRsDA041at4shy6iKIKCJ7OChpU=; b=fWO/6mFByJlsEbvws2UnZXolbkXhCTtUSkfs4E+lJzOb95260mW+xbeSsKSisVxO1O riNWLc+ZNixssJda+7EI5Hd6/j7PVErCennxYuB0difapgFqHDn566ctzUIcR6vzSok+ Q4+VSMBx9n67irCNZN0Osuibop/aN6QdqkmsmIhWiKusAimv2Eeh07uHd1Ctr/M+LeVs S0pHpWst975M3bJ3r10xRnpRFaPyIS5yrS5MaJBG3UOYu24VElKcYKHz67UAMPayFdLP kifVgiKws72BJnmD3KSbPwT77lEjLV3RpPywJqaoewkeFLTawpOnFPtAZH+vRxCvQ6J0 Q1Eg== X-Received: by 10.194.8.163 with SMTP id s3mr1512671wja.41.1370694287787; Sat, 08 Jun 2013 05:24:47 -0700 (PDT) Received: from [127.0.0.1] ([46.182.90.145]) by mx.google.com with ESMTPSA id eq15sm2084352wic.4.2013.06.08.05.24.45 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 08 Jun 2013 05:24:47 -0700 (PDT) Subject: [PATCH v2] nft: fix leak of iterators To: netfilter-devel@vger.kernel.org From: Giuseppe Longo Date: Sat, 08 Jun 2013 14:24:35 +0200 Message-ID: <20130608122435.4354.49219.stgit@localhost> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org This patch fix leak of iterators Signed-off-by: Giuseppe Longo --- iptables/nft.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) -- 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 diff --git a/iptables/nft.c b/iptables/nft.c index c18999b..5a0b814 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -1112,6 +1112,7 @@ next: c = nft_chain_list_iter_next(iter); } + nft_chain_list_iter_destroy(iter); nft_chain_list_free(list); return 1; @@ -1200,6 +1201,7 @@ next: r = nft_rule_list_iter_next(iter); } + nft_rule_list_iter_destroy(iter); nft_rule_list_free(list); /* the core expects 1 for success and 0 for error */ @@ -1276,6 +1278,8 @@ int nft_rule_flush(struct nft_handle *h, const char *chain, const char *table) next: c = nft_chain_list_iter_next(iter); } + + nft_chain_list_iter_destroy(iter); err: nft_chain_list_free(list); @@ -1390,6 +1394,8 @@ next: c = nft_chain_list_iter_next(iter); } + nft_chain_list_iter_destroy(iter); + err: nft_chain_list_free(list);