Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9626ECE58E for ; Thu, 17 Oct 2019 11:07:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9A97E214E0 for ; Thu, 17 Oct 2019 11:07:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394164AbfJQLHz (ORCPT ); Thu, 17 Oct 2019 07:07:55 -0400 Received: from correo.us.es ([193.147.175.20]:46382 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393652AbfJQLHz (ORCPT ); Thu, 17 Oct 2019 07:07:55 -0400 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id E27F711EB20 for ; Thu, 17 Oct 2019 13:07:50 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id D299F21FE4 for ; Thu, 17 Oct 2019 13:07:50 +0200 (CEST) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id C65C2CA0F3; Thu, 17 Oct 2019 13:07:50 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id DB4E2DA7B6; Thu, 17 Oct 2019 13:07:48 +0200 (CEST) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Thu, 17 Oct 2019 13:07:48 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int) Received: from salvia.here (sys.soleta.eu [212.170.55.40]) (Authenticated sender: pneira@us.es) by entrada.int (Postfix) with ESMTPA id AEDEE42EE38F; Thu, 17 Oct 2019 13:07:48 +0200 (CEST) X-SMTPAUTHUS: auth mail.us.es From: Pablo Neira Ayuso To: netfilter-devel@vger.kernel.org Cc: ejallot@gmail.com Subject: [PATCH nft 1/2] src: define flowtable device compound as a list Date: Thu, 17 Oct 2019 13:07:46 +0200 Message-Id: <20191017110747.25985-1-pablo@netfilter.org> X-Mailer: git-send-email 2.11.0 X-Virus-Scanned: ClamAV using ClamSMTP Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org This fixes a memleak when releasing the compound expression via expr_free(). Fixes: 92911b362e90 ("src: add support to add flowtables") Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 2 +- src/parser_json.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser_bison.y b/src/parser_bison.y index 1e2b30015f78..8ad581f69271 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -1826,7 +1826,7 @@ flowtable_expr : '{' flowtable_list_expr '}' flowtable_list_expr : flowtable_expr_member { - $$ = compound_expr_alloc(&@$, EXPR_INVALID); + $$ = compound_expr_alloc(&@$, EXPR_LIST); compound_expr_add($$, $1); } | flowtable_list_expr COMMA flowtable_expr_member diff --git a/src/parser_json.c b/src/parser_json.c index bc29dedf5b4c..55dbc177cc98 100644 --- a/src/parser_json.c +++ b/src/parser_json.c @@ -2914,7 +2914,7 @@ static struct cmd *json_parse_cmd_add_element(struct json_ctx *ctx, static struct expr *json_parse_flowtable_devs(struct json_ctx *ctx, json_t *root) { - struct expr *tmp, *expr = compound_expr_alloc(int_loc, EXPR_INVALID); + struct expr *tmp, *expr = compound_expr_alloc(int_loc, EXPR_LIST); const char *dev; json_t *value; size_t index; -- 2.11.0