From patchwork Wed Jan 22 14:06:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damijan Skvarc X-Patchwork-Id: 1227304 X-Patchwork-Delegate: i.maximets@samsung.com 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=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.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.a=rsa-sha256 header.s=20161025 header.b=n2+IEWQE; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 482nK85Ttsz9sNF for ; Thu, 23 Jan 2020 01:07:08 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2612C87D5D; Wed, 22 Jan 2020 14:07:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fgk7Ppc8m-xx; Wed, 22 Jan 2020 14:07:05 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id AD8D585AA2; Wed, 22 Jan 2020 14:07:01 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 70F6EC0176; Wed, 22 Jan 2020 14:07:01 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0D68EC0174 for ; Wed, 22 Jan 2020 14:07:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EE65186B6B for ; Wed, 22 Jan 2020 14:06:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3CKoWvNjNT-0 for ; Wed, 22 Jan 2020 14:06:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3B8F186B48 for ; Wed, 22 Jan 2020 14:06:59 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id g17so7430087wro.2 for ; Wed, 22 Jan 2020 06:06:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=K+1So11UkzhZjBSDHAJzxUN4r1qPjnYP/75qM8XBDBs=; b=n2+IEWQEwZPXzZFQ+pQf9xTvDRqYwcofgZSFa1yEc5l7VNs7Uzh6HlNFrLOkeSV4jb NYcjiaLGSQwZzfI88dAPCpBWWEFowCqVil/j/0f29aUjaIlNkumE7zW5gHvOZFXPnwtl FXC9XJxYTpSedwByltz0sYqcPgyzm1An2FwSOOjIZhXeO0Esj8/Sk9pmiJDqgvF22c8Y UKoNeN3udpU37x0NIrt8jYm0AOHu9mF1J/+1seGkSsjDkVl6D5DV5+hN9ubuNbsiZllV 5COMN+u/N2smw1XBbB3kxMz56fFtbUW9rLSEbzo6S6NARw9iQSFsd4DDIGTKbbuxA8c6 KgYg== 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=K+1So11UkzhZjBSDHAJzxUN4r1qPjnYP/75qM8XBDBs=; b=ty2cw10+e6GZ0Vg0DYLYi3K1wgH0hGACksglWBo1X0c7RampZbn6QbD5iekO5+mVCc gBDlHhR5Kb4q1mI5KVBTL/iO48Ixv5v7U6CRm4aznDhOQok9hLaGSk6Gb3zipubI6Ldk KSsZYA/Ddi5QIKq7rF7JYsFPTHKiTkXDMgDWUIvYddeDORUNAcmLBU0GPL23pIgZgfUy AUOkam0rt0nbY1hanu+gB6pGpdzI81fkZMXnXsrALIe6OVsUWfPyJg2lufXu9O1qC7bL 4bucC5Xvs40vNDbvlOFhXcVucTtNMmDdUN/hO8e0IotxkGch37yFck5COUT5ezzFrWqk R+9g== X-Gm-Message-State: APjAAAWxP+hHPqDVVVBypljz+pp2n8/z0OJeep8K8StOt8SobZzgPpA3 ce7LcevMSetExlBJiEfd6u2sjeat80w= X-Google-Smtp-Source: APXvYqwf/Fh58IniL3QERTH1SdL0tAzYfBXMnrn0FwY4vxk8RpEQz2HgiFvm6OowavNu19vHeGyyhw== X-Received: by 2002:a05:6000:12:: with SMTP id h18mr10994346wrx.87.1579702017264; Wed, 22 Jan 2020 06:06:57 -0800 (PST) Received: from damijan-PC.i-tech.local (mail.i-tech.si. [89.212.78.105]) by smtp.gmail.com with ESMTPSA id d14sm61484529wru.9.2020.01.22.06.06.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Jan 2020 06:06:56 -0800 (PST) From: Damijan Skvarc To: dev@openvswitch.org Date: Wed, 22 Jan 2020 15:06:43 +0100 Message-Id: <1579702003-5122-1-git-send-email-damjan.skvarc@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [ovs-dev] [PATCH 1/1] dpif: fix memory leak while dumping dpif flows 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" leak was detected by running test: "ofproto-dpif - balance-tcp bonding" Signed-off-by: Damijan Skvarc --- ofproto/ofproto-dpif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index d3cb392..e8c851e 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -6281,7 +6281,8 @@ ofproto_unixctl_dpif_dump_flows(struct unixctl_conn *conn, flow_dump_thread = dpif_flow_dump_thread_create(flow_dump); while (dpif_flow_dump_next(flow_dump_thread, &f, 1)) { struct flow flow; - + /* no need for extra info */ + free(f.attrs.dp_extra_info); if ((odp_flow_key_to_flow(f.key, f.key_len, &flow, NULL) == ODP_FIT_ERROR) || (xlate_lookup_ofproto(ofproto->backer, &flow, NULL, NULL)