All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: fix leak of block histogram data
@ 2026-10-12 11:43 Daniel P. Berrangé
  2026-10-13 18:58 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel P. Berrangé @ 2026-10-12 11:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, qemu-block, Hanna Reitz, Daniel P. Berrangé

The block_acct_cleanup method failed to release memory associated
with block histograms.

Fixes: b741ae7417 (block/accounting: introduce latency histogram)
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 block/accounting.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/block/accounting.c b/block/accounting.c
index 038af370170..40ed70782b4 100644
--- a/block/accounting.c
+++ b/block/accounting.c
@@ -80,6 +80,13 @@ bool block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invalid,
 void block_acct_cleanup(BlockAcctStats *stats)
 {
     BlockAcctTimedStats *s, *next;
+    size_t i;
+    for (i = 0; i < BLOCK_MAX_IOTYPE; i++) {
+        BlockLatencyHistogram *hist = &stats->latency_histogram[i];
+        g_free(hist->bins);
+        g_free(hist->boundaries);
+    }
+
     QSLIST_FOREACH_SAFE(s, &stats->intervals, entries, next) {
         g_free(s);
     }
-- 
2.56.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-13 18:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-12 11:43 [PATCH] block: fix leak of block histogram data Daniel P. Berrangé
2026-10-13 18:58 ` Eric Blake

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.