From patchwork Wed Jun 2 15:23:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Sutter X-Patchwork-Id: 1486769 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=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4FwCWP4fXnz9sCD for ; Thu, 3 Jun 2021 01:24:49 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231739AbhFBP0c (ORCPT ); Wed, 2 Jun 2021 11:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231848AbhFBP0b (ORCPT ); Wed, 2 Jun 2021 11:26:31 -0400 Received: from orbyte.nwl.cc (orbyte.nwl.cc [IPv6:2001:41d0:e:133a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43BA5C061574 for ; Wed, 2 Jun 2021 08:24:47 -0700 (PDT) Received: from localhost ([::1]:43124 helo=xic) by orbyte.nwl.cc with esmtp (Exim 4.94.2) (envelope-from ) id 1loSjd-0007QB-NT; Wed, 02 Jun 2021 17:24:45 +0200 From: Phil Sutter To: Pablo Neira Ayuso Cc: netfilter-devel@vger.kernel.org Subject: [iptables PATCH 3/9] libxtables: Fix memleak in xtopt_parse_hostmask() Date: Wed, 2 Jun 2021 17:23:57 +0200 Message-Id: <20210602152403.5689-4-phil@nwl.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210602152403.5689-1-phil@nwl.cc> References: <20210602152403.5689-1-phil@nwl.cc> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org The allocated hostmask duplicate needs to be freed again. Fixes: 66266abd17adc ("libxtables: XTTYPE_HOSTMASK support") Signed-off-by: Phil Sutter --- libxtables/xtoptions.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libxtables/xtoptions.c b/libxtables/xtoptions.c index d329f2ff7979e..0dcdf607f4678 100644 --- a/libxtables/xtoptions.c +++ b/libxtables/xtoptions.c @@ -763,6 +763,7 @@ static void xtopt_parse_hostmask(struct xt_option_call *cb) cb->arg = p; xtopt_parse_plenmask(cb); cb->arg = orig_arg; + free(work); } static void xtopt_parse_ethermac(struct xt_option_call *cb)