From patchwork Sun Mar 19 17:22:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 740727 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3vmQqr4b0Xz9s7M for ; Mon, 20 Mar 2017 04:22:16 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 4D8A495E; Sun, 19 Mar 2017 17:22:13 +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 51863932 for ; Sun, 19 Mar 2017 17:22:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A563B16D for ; Sun, 19 Mar 2017 17:22:10 +0000 (UTC) Received: from mfilter22-d.gandi.net (mfilter22-d.gandi.net [217.70.178.150]) by relay2-d.mail.gandi.net (Postfix) with ESMTP id 1F935C5A55; Sun, 19 Mar 2017 18:22:09 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter22-d.gandi.net Received: from relay2-d.mail.gandi.net ([IPv6:::ffff:217.70.183.194]) by mfilter22-d.gandi.net (mfilter22-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id gVxwS6p-Zvcs; Sun, 19 Mar 2017 18:22:07 +0100 (CET) X-Originating-IP: 173.228.112.115 Received: from sigabrt.gateway.sonic.net (173-228-112-115.dsl.dynamic.fusionbroadband.com [173.228.112.115]) (Authenticated sender: blp@ovn.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 5458AC5A54; Sun, 19 Mar 2017 18:22:06 +0100 (CET) From: Ben Pfaff To: dev@openvswitch.org Date: Sun, 19 Mar 2017 10:22:05 -0700 Message-Id: <20170319172205.30125-1-blp@ovn.org> X-Mailer: git-send-email 2.10.2 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH] ovsdb-server: Fix memory leak in update_remote_status() error path. 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 Found by inspection. Signed-off-by: Ben Pfaff Acked-by: Andy Zhou --- ovsdb/ovsdb-server.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index 52af4d36aeb9..4f88500a054d 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2016 Nicira, Inc. +/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2016, 2017 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1076,8 +1076,9 @@ update_remote_status(const struct ovsdb_jsonrpc_server *jsonrpc, db = node->data; error = ovsdb_txn_commit(db->txn, false); if (error) { - VLOG_ERR_RL(&rl, "Failed to update remote status: %s", - ovsdb_error_to_string(error)); + char *msg = ovsdb_error_to_string(error); + VLOG_ERR_RL(&rl, "Failed to update remote status: %s", msg); + free(msg); ovsdb_error_destroy(error); } }