From patchwork Fri Aug 2 06:23:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damijan Skvarc X-Patchwork-Id: 1140975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="R0t8Vc6y"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 460HDV1jLPz9s3Z for ; Fri, 2 Aug 2019 16:23:52 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 26B20DD4; Fri, 2 Aug 2019 06:23:49 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id BD038DD2 for ; Fri, 2 Aug 2019 06:23:48 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 3545FE7 for ; Fri, 2 Aug 2019 06:23:48 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id z1so75899670wru.13 for ; Thu, 01 Aug 2019 23:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=JohPPtar62tRLQJMa5QRY/5coqjBRMbhLoD22l18V0s=; b=R0t8Vc6yWI+UisuXE0gMePFkB8lqjD7KUkal/7TALdQuqMlvU+zeNCr67g9s4IBMXX HZb3lk+MaJoxTsNYvn3vj17AuwtoFiBGsrZjPY9tXLK1Qz/Xo7KrlC3jW6xbfSz3g8/O Y5WXXh+wtykZ8W0fw6QJLj5gV121GkrYPRmvXTdTjNbGcKpTh81xf83luAHVwmX6tUgE ZlgE5arbdRoh4f0kF4MMQoWVc4JWrumEUcBzYiFWOsVFQSIdqwg/p1l2ahNGDtOhd4qS j37YuOoa7Z6+6eiqdcNB82zjldc+WG63E40VPzyvuANK0pxWJux+wDTuPqtgjpbr0X1B t8vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JohPPtar62tRLQJMa5QRY/5coqjBRMbhLoD22l18V0s=; b=fKaYzU87QCZPZf3KNRB4eQcxvVeKaGQvVVtWT75CePFQYGICOUdiIhpyELaeAYXHGh xYPmwW/zAxDCGwnWSXlBz88K2gPGnuJVI9qx0IUrc4MurXg2zBc1vJmkxp+yhkvPttdA 5Bs6CPArNWlF6iKll/mb/dc7HOYosv6SoFzbMUrg18Yo13hmfuqz07ckFavsLmyvP6Er votH+A3ufp7Rn5RBZerNnDX4m1oI963Yyl93kHm7KVXkCBX64tSkhQQUUyWUpl3Mzl+D n6EOtJs4tW2SeF1+6OUDYMUhxI9rWvWahF/vplQKwbXJueQ2+44w3ahVBPNl2MHtO7T6 KQHQ== X-Gm-Message-State: APjAAAU6MZedWRKDNtJZPksUoW05BpZGMCyiiV95mFoThA4s8i9w3pDG z3Dt/HL0xOi3Z/17wmUzQkU= X-Google-Smtp-Source: APXvYqx3Nuy8ce0DHV+RTJTaGkGYM8f5q5yVD3DPDBJ9jg8rH5mgB36RtLsMKFrvshklzVg2UZ3f8A== X-Received: by 2002:a5d:518f:: with SMTP id k15mr85545817wrv.321.1564727026773; Thu, 01 Aug 2019 23:23:46 -0700 (PDT) Received: from damijan-PC.i-tech.local (mail.i-tech.si. [89.212.78.105]) by smtp.gmail.com with ESMTPSA id t6sm85475720wmb.29.2019.08.01.23.23.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Aug 2019 23:23:45 -0700 (PDT) From: Damijan Skvarc To: mmichels@redhat.com, dev@openvswitch.org Date: Fri, 2 Aug 2019 08:23:19 +0200 Message-Id: <1564726999-19473-1-git-send-email-damjan.skvarc@gmail.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 1/1] ovn-northd: fix memory leak in add_distributed_nat_routes() function X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Within this function actions & match dynamic strings are used as helper variables for adding entries into logical flow table. Variables are used several times in order to optimize number of memory allocations, however at the end memory was forgotten to be deallocated. Signed-off-by: Damijan Skvarc Acked-by: Mark Michelson Signed-off-by: Mark Michelson --- ovn/northd/ovn-northd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index ae09cf3..95b9570 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -5717,6 +5717,8 @@ add_distributed_nat_routes(struct hmap *lflows, const struct ovn_port *op) ds_clear(&actions); } } + ds_destroy(&match); + ds_destroy(&actions); } static void