From patchwork Wed Jul 27 01:28:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 653035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3rzcny45zZz9t0G for ; Wed, 27 Jul 2016 11:28:36 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=t4QzXAso; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 6D21A10A78; Tue, 26 Jul 2016 18:28:35 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 9708F10A77 for ; Tue, 26 Jul 2016 18:28:33 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 2A4E916210E for ; Tue, 26 Jul 2016 19:28:33 -0600 (MDT) X-ASG-Debug-ID: 1469582912-0b323747736fc10001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar6.cudamail.com with ESMTP id VyRgWUL3zrJfxqHR (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 26 Jul 2016 19:28:32 -0600 (MDT) X-Barracuda-Envelope-From: u9012063@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mail-pa0-f68.google.com) (209.85.220.68) by mx1-pf2.cudamail.com with ESMTPS (AES128-SHA encrypted); 27 Jul 2016 01:28:31 -0000 Received-SPF: pass (mx1-pf2.cudamail.com: SPF record at _netblocks.google.com designates 209.85.220.68 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.220.68 X-Barracuda-RBL-IP: 209.85.220.68 Received: by mail-pa0-f68.google.com with SMTP id ez1so789017pab.3 for ; Tue, 26 Jul 2016 18:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=Vr0/6MLv5CEdWgdRggnurJ+vU0wRbVFHFIt7PIVfF80=; b=t4QzXAso2ccecEHWErDkFQTj6zCZsEpuw6w/K3TdEb4VCY3AGd4dYuEyBLDHDShR53 0wsZA3zZ/ZA7PvebuYJpBWPqqn+5WPaj7M6jkL4EfT8POpASevfBOxJTCCmk2UJ+O5ZE 8qrk7e17xzakinUK6cHvWrMqUZFNHN1FvXoVK/cW/OAvGrHHXUfoJEsVF0rMPM7LdfRz ZA1dd3jeN8l0ZpUbnRwcaBbSqCnIxyppfS1CYEN9i74rwekpsHt4EubfUXhdoPYGsJ1j xn7kKaBxjXUflewGXtNQmileg+q6KSr3zI6Fu0PhSpvXS9XHrjsueJILqtm2EeaXaUwn 0u+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=Vr0/6MLv5CEdWgdRggnurJ+vU0wRbVFHFIt7PIVfF80=; b=EVjEFvbrURNsjR9FUpwfeL4ujhX7n2thatOIl1uBG4XqaY6NPZnLkjF2NZjluiJ6g3 8ZTAvgAjn4Rtrderabzh0q2A+Fn5zR9Y69HSfufyjtV0rlxrw5iB+m3j3eb3kDnxCNhn BDHgMMzb79YXchqaitELJTysfa7mxQ+C7jvcGVIYIcEzMTpZCeyU5XfSjFCDV10bLvo0 mP1yflXCzT52T3Vo0cIcF4ljkOwV2VRobj0/T9dqsKUfaEMA0rVajeyOhxbP8lanKRlQ Qoss5NZDKcPp3LSxaYgShVzirLFnglr6HfggKFrB6R3tqCOM/DcwhgPuSAsyQg+hpuvR Deng== X-Gm-Message-State: AEkoouukG7s9wpi6h/JAPOXgZPvg2PGa7SsC5Rrxf3bWeT/C8zQhI2hicEnM4987Eo8wdw== X-Received: by 10.67.30.103 with SMTP id kd7mr44266246pad.83.1469582911227; Tue, 26 Jul 2016 18:28:31 -0700 (PDT) Received: from vm-dev.localdomain ([73.93.155.36]) by smtp.gmail.com with ESMTPSA id lf11sm4238349pab.17.2016.07.26.18.28.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jul 2016 18:28:30 -0700 (PDT) X-CudaMail-Envelope-Sender: u9012063@gmail.com From: William Tu To: dev@openvswitch.org X-CudaMail-MID: CM-E2-725088723 X-CudaMail-DTE: 072616 X-CudaMail-Originating-IP: 209.85.220.68 Date: Tue, 26 Jul 2016 18:28:30 -0700 X-ASG-Orig-Subj: [##CM-E2-725088723##][PATCH] ovsdb: Fix memory leak in execute_update. Message-Id: <1469582910-64371-1-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.5.0 X-GBUdb-Analysis: 0, 209.85.220.68, Ugly c=0.392278 p=-0.377778 Source Normal X-MessageSniffer-Rules: 0-0-0-4992-c X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1469582912 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 1.60 X-Barracuda-Spam-Status: No, SCORE=1.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC1_TG070, BSF_SC5_MJ1963, DKIM_SIGNED, MAILTO_TO_SPAM_ADDR, RDNS_NONE, WEIRD_PORT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.31545 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 MAILTO_TO_SPAM_ADDR URI: Includes a link to a likely spammer email 0.50 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC1_TG070 Custom Rule TG070 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Subject: [ovs-dev] [PATCH] ovsdb: Fix memory leak in execute_update. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Valgrind testcase 1804 ovsdb-server.at:1023 insert rows, update rows by value reports the following leak. json_from_string (json.c:1025) execute_update (replication.c:614), similarily at execute_delete() process_table_update (replication.c:502) process_notification.part.5 (replication.c:445) process_notification (replication.c:402) check_for_notifications (replication.c:418) replication_run (replication.c:110) Signed-off-by: William Tu --- ovsdb/replication.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ovsdb/replication.c b/ovsdb/replication.c index af7ae5c..fe89d39 100644 --- a/ovsdb/replication.c +++ b/ovsdb/replication.c @@ -573,6 +573,8 @@ execute_delete(struct ovsdb_txn *txn, const char *uuid, } ovsdb_condition_destroy(&condition); + json_destroy(CONST_CAST(struct json *, where)); + return error; } @@ -630,6 +632,7 @@ execute_update(struct ovsdb_txn *txn, const char *uuid, ovsdb_row_destroy(row); ovsdb_column_set_destroy(&columns); ovsdb_condition_destroy(&condition); + json_destroy(CONST_CAST(struct json *, where)); return error; }