From patchwork Sun Mar 10 16:02:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10846357 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC8136C2 for ; Sun, 10 Mar 2019 16:18:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C753428A30 for ; Sun, 10 Mar 2019 16:18:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BACB228D65; Sun, 10 Mar 2019 16:18:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 33CC728A30 for ; Sun, 10 Mar 2019 16:18:27 +0000 (UTC) Received: from localhost ([127.0.0.1]:46876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h319e-0003LK-IF for patchwork-qemu-devel@patchwork.kernel.org; Sun, 10 Mar 2019 12:18:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h317x-0002cx-Ox for qemu-devel@nongnu.org; Sun, 10 Mar 2019 12:16:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h30uN-0002AM-5U for qemu-devel@nongnu.org; Sun, 10 Mar 2019 12:02:39 -0400 Received: from m12-15.163.com ([220.181.12.15]:54318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h30uK-00029K-V7 for qemu-devel@nongnu.org; Sun, 10 Mar 2019 12:02:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=9SmEzLQI1uR21ZY+1X jA/DXKiGC8Ed9L36zcO6U70ZU=; b=LXuWoShMR/zMT/ZMaU6W6UfLhIq5HI//cZ 9vEPipJK0lOpHVRdy02zHSpLPNnegZ6A8EoQ08TCl6e6qwYtiGqDNHWgJT+7YhOw iwxoPCmo8m6CLKThhEwbxmiGeYSrA3NuPoPpUrknDxdouPHqPaHuprES4+ebcsbW +O1Pr7D2U= Received: from localhost.localdomain (unknown [122.233.115.62]) by smtp11 (Coremail) with SMTP id D8CowAAX49MZNYVcg7GeAw--.26395S2; Mon, 11 Mar 2019 00:02:34 +0800 (CST) From: Li Qiang To: pbonzini@redhat.com, e.emanuelegiuseppe@gmail.com Date: Sun, 10 Mar 2019 09:02:27 -0700 Message-Id: <20190310160227.103090-1-liq3ea@163.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: D8CowAAX49MZNYVcg7GeAw--.26395S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7GF47uFyfAw13CFy7Cr4DArb_yoWkZrbEka n7Z3sa9FsxAFWxZrn8uw1xZF48Ww18Xrn7GwsrKF43Cayjv3WYgrykXrnFy3yfur43G39x tws8Aw4FyrnFyjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU1xpnJUUUUU== X-Originating-IP: [122.233.115.62] X-CM-SenderInfo: 5oltjvrd6rljoofrz/xtbBaxpzbVetuRWsdwAAsi X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.15 Subject: [Qemu-devel] [PATCH] tests: test-qgraph: fix a memory leak X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Qiang , liq3ea@gmail.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Spotted by ASAN when 'make check'. Signed-off-by: Li Qiang Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé --- tests/test-qgraph.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test-qgraph.c b/tests/test-qgraph.c index f6a6565e31..5c7e457075 100644 --- a/tests/test-qgraph.c +++ b/tests/test-qgraph.c @@ -122,7 +122,7 @@ static void check_driver(const char *driver) static void check_test(const char *test, const char *interface) { QOSGraphEdge *edge; - const char *full_name = g_strdup_printf("%s-tests/%s", interface, test); + char *full_name = g_strdup_printf("%s-tests/%s", interface, test); qos_add_test(test, interface, testfunct, NULL); g_assert_cmpint(qos_graph_has_machine(test), ==, FALSE); @@ -138,6 +138,7 @@ static void check_test(const char *test, const char *interface) g_assert_cmpint(qos_graph_get_node_availability(full_name), ==, TRUE); qos_graph_node_set_availability(full_name, FALSE); g_assert_cmpint(qos_graph_get_node_availability(full_name), ==, FALSE); + g_free(full_name); } static void count_each_test(QOSGraphNode *path, int len)