From 649499425f8e6c426b5849c656eff9747dbc8ad6 Mon Sep 17 00:00:00 2001 From: oltolm Date: Mon, 26 Jan 2026 20:38:23 +0100 Subject: [PATCH] xemu-snapshots.c: Check bs_ro refcnt before unref --- ui/xemu-snapshots.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/xemu-snapshots.c b/ui/xemu-snapshots.c index 503a7a50b0..3e0927edb8 100644 --- a/ui/xemu-snapshots.c +++ b/ui/xemu-snapshots.c @@ -169,8 +169,8 @@ static void xemu_snapshots_all_load_data(QEMUSnapshotInfo **info, bdrv_flush(bs_ro); bdrv_drain(bs_ro); + assert(bs_ro->refcnt == 1); bdrv_unref(bs_ro); - assert(bs_ro->refcnt == 0); if (!(*err)) xemu_snapshots_dirty = false; }