From patchwork Wed Aug 7 11:28:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damijan Skvarc X-Patchwork-Id: 1143462 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="LN/a3fw2"; 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 463Tm12tFRz9sDB for ; Wed, 7 Aug 2019 21:28:48 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 626A0DC6; Wed, 7 Aug 2019 11:28:45 +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 302F39CA for ; Wed, 7 Aug 2019 11:28:44 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9BEA17D2 for ; Wed, 7 Aug 2019 11:28:43 +0000 (UTC) Received: by mail-ed1-f68.google.com with SMTP id k21so85888705edq.3 for ; Wed, 07 Aug 2019 04:28:43 -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=gOqbvYHkpPIuVnCyYsbxTOVl++7deaabVxJT/OxnGZU=; b=LN/a3fw2xVUvtfWWdeaEVU3RivBFi4WzqsW1lv+B+oaVsnf1DqpugIOcUQdr5pg1SW sGr3heBhhYTIhMNJ6mpWmSeDxNLYM3EKarmjaUSPv8iDRS3x3d2XpF2zUxMAns3UYwzt nVolNm+AkDPDICGr+ZMkhMJd1YPdJDpsXyPqCgH+d5SoH1o33SLrBGQSc5ZQpaudjQzT uEPgOf1nbRcWl1EjB1tu2nRJ8UNsc7UfB9P0C4WV01pLhMAQ2wM3XXdffSWmrGdIL0YW te0LdY+Mx9NYkqmAfBl7dnNw3innk+AiWLUZTvEPXTtcqaN53vO0mx5yryCNxc3+7b2s 26XA== 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=gOqbvYHkpPIuVnCyYsbxTOVl++7deaabVxJT/OxnGZU=; b=GGprEhLe5LgnFNWnpAwBzSZk9ChIWr+C0G104WI3s/KXn0X1DC79hofZQUtcqt7SE2 fTVSPa61Fm9HZg+//e9CuhHdc31Y8JFpDkKBTbv/9ymzWHhGipdnbEvQvRAPoJbVD8Rb 159QN6Ce7HiMv+cEZtCA58M85ndBQoCAnX3tBZ9EpzqSy7gfVZ0K8uhmNSES55Uaals0 bFBo1gCSPK8gOBP8JujTPW88S9OnxUO1D/bZr9ajt/CViw+bT5rOAOmX9X4mrRWjchfI KedhzGOq9SAVH0PJp8QXzgldS0BdYDzOwtLLdRwW4O6S9B7AAIQ3WbTz5o+wFd6R7JXj 7B6A== X-Gm-Message-State: APjAAAVh1mWK12oQtNQnb67NzL5355Ot6mrcVaufnsGaeCpM6cgjy6G1 HdzMKC6OsICJPO7hH2Ht++TgnmFC X-Google-Smtp-Source: APXvYqwQ+cOm3KhhBhi2LDN1Emo7UClMdx+eOk8yJ9F08ZBhNQvqERUNo6zECbcndDRohYfTJ7vWCw== X-Received: by 2002:a17:906:4e8f:: with SMTP id v15mr7751977eju.47.1565177321776; Wed, 07 Aug 2019 04:28:41 -0700 (PDT) Received: from damijan-PC.i-tech.local (mail.i-tech.si. [89.212.78.105]) by smtp.gmail.com with ESMTPSA id r13sm20440663eds.35.2019.08.07.04.28.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Aug 2019 04:28:40 -0700 (PDT) From: Damijan Skvarc To: dev@openvswitch.org Date: Wed, 7 Aug 2019 13:28:17 +0200 Message-Id: <1565177297-27087-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 --- northd/ovn-northd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 979dea4..8588961 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -5667,6 +5667,8 @@ add_distributed_nat_routes(struct hmap *lflows, const struct ovn_port *op) ds_clear(&actions); } } + ds_destroy(&match); + ds_destroy(&actions); } static void