From 622d241998b6a981483594712b039190ee94eff8 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 6 Mar 2012 18:55:54 +0100 Subject: [PATCH] use QSIMPLEQ_FOREACH_SAFE when freeing list elements Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- blockdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 0e8666a874..3abc1dab84 100644 --- a/blockdev.c +++ b/blockdev.c @@ -736,7 +736,7 @@ void qmp_blockdev_group_snapshot_sync(SnapshotDevList *dev_list, int ret = 0; SnapshotDevList *dev_entry = dev_list; SnapshotDev *dev_info = NULL; - BlkGroupSnapshotStates *states; + BlkGroupSnapshotStates *states, *next; BlockDriver *proto_drv; BlockDriver *drv; int flags; @@ -842,7 +842,7 @@ delete_and_fail: } } exit: - QSIMPLEQ_FOREACH(states, &snap_bdrv_states, entry) { + QSIMPLEQ_FOREACH_SAFE(states, &snap_bdrv_states, entry, next) { g_free(states); } return; -- GitLab