From patchwork Wed Aug 17 07:49:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Seibert X-Patchwork-Id: 1667135 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=syseleven.de header.i=@syseleven.de header.a=rsa-sha256 header.s=2022n001 header.b=KaizTGdi; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4M70lJ2kQbz1yYg for ; Wed, 17 Aug 2022 17:58:52 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 745D940D7A; Wed, 17 Aug 2022 07:58:50 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 745D940D7A Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=syseleven.de header.i=@syseleven.de header.a=rsa-sha256 header.s=2022n001 header.b=KaizTGdi X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qFMc6SVpgcOQ; Wed, 17 Aug 2022 07:58:49 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id A1692408DA; Wed, 17 Aug 2022 07:58:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org A1692408DA Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 66290C0032; Wed, 17 Aug 2022 07:58:48 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 77FABC002D for ; Wed, 17 Aug 2022 07:58:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 4113B408DA for ; Wed, 17 Aug 2022 07:58:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4113B408DA X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 93z9OwCHushy for ; Wed, 17 Aug 2022 07:58:44 +0000 (UTC) X-Greylist: delayed 00:09:24 by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 0D19640D74 Received: from out-cbk.mail.syseleven.net (out-cbk.mail.syseleven.net [195.192.142.27]) by smtp2.osuosl.org (Postfix) with ESMTPS id 0D19640D74 for ; Wed, 17 Aug 2022 07:58:43 +0000 (UTC) Received: from 127.0.0.1 (localhost [127.0.0.1]) by out-cbk.mail.syseleven.net (Postfix) with ESMTPSA id 1856E3F088; Wed, 17 Aug 2022 07:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=syseleven.de; s=2022n001; t=1660722557; bh=qzgokRbmTSnmD6L3ZxMPtutBlvKpX0XsCbAkkx4eQPo=; h=Date:From:To:Cc:Subject:From; b=KaizTGdiGs8OEeciIra/bryj842TxefB/hEvosnF0X4SPN1nP3hA6fsNMF6xFLYoA nyAhZTFKYiSs07NymsUk2agvRUWte3DmjVS849ca12daUEvMYYeIJ225f8eab35YVj 6KC+Iu9PFQOVtoRBez/PFAk+LXBmPLmw6HJe/MLlaioy7ISICVCuFMs30oN1Xl45cd 3ATjS6WNcNIxBuiP4JtbsfFzwUqEn43++OdfD7PuCuyXvQ817PeafPopERbO9yZWUW 1as/6hZ/CMBrD6a4bQAsHNBK7p+l8inM2hn0NuuIjGAw46IMzRspvkDiojzN12p71T C2MYP6m4A/Srg== Date: Wed, 17 Aug 2022 09:49:12 +0200 To: OVS development Message-ID: MIME-Version: 1.0 Content-Disposition: inline Subject: [ovs-dev] [PATCH ovn] northd: Fix memory leak. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Olaf Seibert via dev From: Olaf Seibert Reply-To: Olaf Seibert Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Commit 7b56f69580e1f390d9c6753a2cb8f0dbfbb4c467 cloned the external_ids to ids, then passed them to sbrec_port_binding_set_external_ids(). The intermediate step is unneeded (and caused a memory leak). Pass the external_ids directly. Signed-off-by: Olaf Seibert Acked-by: Ales Musil --- northd/northd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index 09eccf4d9..309b449dd 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -3435,9 +3435,7 @@ ovn_port_update_sbrec(struct northd_input *input_data, sbrec_port_binding_set_mac(op->sb, &addresses, 1); ds_destroy(&s); - struct smap ids = SMAP_INITIALIZER(&ids); - smap_clone(&ids, &op->nbrp->external_ids); - sbrec_port_binding_set_external_ids(op->sb, &ids); + sbrec_port_binding_set_external_ids(op->sb, &op->nbrp->external_ids); sbrec_port_binding_set_nat_addresses(op->sb, NULL, 0); } else {