From patchwork Wed May 5 09:22:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 12239471 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B201C433ED for ; Wed, 5 May 2021 09:25:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C5A98613F0 for ; Wed, 5 May 2021 09:25:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5A98613F0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDn2-0002Ux-ML for qemu-devel@archiver.kernel.org; Wed, 05 May 2021 05:25:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leDkR-0000sk-Cz for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:15 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:45807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leDkJ-00056l-Jp for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:15 -0400 Received: by mail-wm1-x32c.google.com with SMTP id s5-20020a7bc0c50000b0290147d0c21c51so691975wmh.4 for ; Wed, 05 May 2021 02:23:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ydPT0ztE2Bw0rnFw4k7WbHBh286HstrN5c/fEJLUTGA=; b=lw51i2KQmYSfL0VWNhGU3wOMQBgyQFZX0BgQM/hi01D5Y8+JpKHa0w1gxyt4Zt49YV FAMmIx/3na9aLo8darGgFiQCkHHPKy+ccM8ZrKsPPdYO6WqA8+2Bm3hRjTyEPECEQX+V 9Jh37+oraB6WniA23aTExmbQhqWe2Ejodaq+0sIuriQPsxxrzcFigGZvmL82G3siZHjB Blf2jNP6CbInfZPSOs0AuP9c4/2h9MyYR2AB9eHWpi4qVuQY6BNZvy3AN2oy2/pfp9UB 0RkBzmnJCAbd/DXZD9KXc4M2Zs+WQuEcPqJrJtdrYvGOsrZOvvX7gGdRuiWuvjKYPjIe rscQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ydPT0ztE2Bw0rnFw4k7WbHBh286HstrN5c/fEJLUTGA=; b=tyxcjE+j8GnWIWNd5UVF6nDIYLjrddD0/2EkPhplIYSBdpOho49fU+h6Yie5jpFsY1 aPlqENTdJItAR1EQgbcn7iVYliDDJFKZAp1irZO80VVQ2027LDPMFO6RLjoMRlYCSHxl D/p4w5FAqSdeIspcYk9YisuG3Hd50vhpPgw/ix72gCG9CnccZi0NR9Xr5h87MbdGTwmr hqkjeELrX7QWD26HibD6FEDFIqSd5//VcCL1RSLbnyPkYFjo8YH+CoNKgOeQWR/BjUL3 MaA2XjR+Zjudo5cLwQhgFuVVNEqbxmD+f3TtkP1tZP0WG/UGcUnyz8Ls8SNOj3k7XFLl XP/A== X-Gm-Message-State: AOAM532ZvmGvs/5ktCx59if1q3j/nsCjVZMILdYCW6Ff5A5bPaYy/ftg kfuFbpOxjPEuoX7xgwKA2DJ3LQ== X-Google-Smtp-Source: ABdhPJyCwdVIrdEerNQtPOGB5ST68y8ICf2cJFHLN2yY5rYVbYlen8oa8SXRtgGzTZvEBwdFZR+xIw== X-Received: by 2002:a1c:4302:: with SMTP id q2mr8887749wma.1.1620206581890; Wed, 05 May 2021 02:23:01 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f11sm5363048wmq.41.2021.05.05.02.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 02:23:00 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 149DE1FF8F; Wed, 5 May 2021 10:23:00 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 3/7] plugins/hotblocks: Properly freed the hash table values Date: Wed, 5 May 2021 10:22:55 +0100 Message-Id: <20210505092259.8202-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210505092259.8202-1-alex.bennee@linaro.org> References: <20210505092259.8202-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , minyihh@uci.edu, robhenry@microsoft.com, vilanova@imperial.ac.uk, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, mohamad.gebai@gmail.com, kuhn.chenqun@huawei.com, Mahmoud Mandour , matheus.ferst@eldorado.org.br Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Mahmoud Mandour Freed the values stored in the hash table ``hotblocks`` returned by ``g_hash_table_get_values()`` by freeing the sorted list and destroyed the hash table afterward. Signed-off-by: Mahmoud Mandour Signed-off-by: Alex Bennée Message-Id: <20210422005043.3569-2-ma.mandourr@gmail.com> --- contrib/plugins/hotblocks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 4b08340143..64692c0670 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -68,10 +68,11 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) rec->insns, rec->exec_count); } - g_list_free(it); + g_list_free_full(it, g_free); g_mutex_unlock(&lock); } + g_hash_table_destroy(hotblocks); qemu_plugin_outs(report->str); }