From patchwork Tue Jun 16 11:08:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Sutter X-Patchwork-Id: 1310246 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=nwl.cc Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49mQRB3FJjz9sRh for ; Tue, 16 Jun 2020 21:08:06 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726526AbgFPLIF (ORCPT ); Tue, 16 Jun 2020 07:08:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725768AbgFPLID (ORCPT ); Tue, 16 Jun 2020 07:08:03 -0400 Received: from orbyte.nwl.cc (orbyte.nwl.cc [IPv6:2001:41d0:e:133a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C2FC08C5C2 for ; Tue, 16 Jun 2020 04:08:03 -0700 (PDT) Received: from localhost ([::1]:56938 helo=tatos) by orbyte.nwl.cc with esmtp (Exim 4.94) (envelope-from ) id 1jl9Rh-0003f8-5S; Tue, 16 Jun 2020 13:08:01 +0200 From: Phil Sutter To: Pablo Neira Ayuso Cc: netfilter-devel@vger.kernel.org Subject: [iptables PATCH] xtables-translate: Use proper clear_cs function Date: Tue, 16 Jun 2020 13:08:02 +0200 Message-Id: <20200616110802.9122-1-phil@nwl.cc> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Avoid memleaks by performing a full free of any allocated data in local iptables_command_state variable. Signed-off-by: Phil Sutter --- iptables/xtables-translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iptables/xtables-translate.c b/iptables/xtables-translate.c index 5aa42496b5a48..c348c4df4933c 100644 --- a/iptables/xtables-translate.c +++ b/iptables/xtables-translate.c @@ -316,7 +316,7 @@ static int do_command_xlate(struct nft_handle *h, int argc, char *argv[], exit(1); } - xtables_rule_matches_free(&cs.matches); + nft_clear_iptables_command_state(&cs); if (h->family == AF_INET) { free(args.s.addr.v4);