diff mbox series

[PULL,28/29] plugins/hotblocks: Properly freed the hash table values

Message ID 20210517161022.13984-29-alex.bennee@linaro.org
State New
Headers show
Series testing and plugin updates | expand

Commit Message

Alex Bennée May 17, 2021, 4:10 p.m. UTC
From: Mahmoud Mandour <ma.mandourr@gmail.com>


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 <ma.mandourr@gmail.com>

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Message-Id: <20210422005043.3569-2-ma.mandourr@gmail.com>
Message-Id: <20210505092259.8202-4-alex.bennee@linaro.org>

-- 
2.20.1
diff mbox series

Patch

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);
 }