提交 622d2419 编写于 作者: P Paolo Bonzini 提交者: Kevin Wolf

use QSIMPLEQ_FOREACH_SAFE when freeing list elements

Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 b8c6f29e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册