use QSIMPLEQ_FOREACH_SAFE when freeing list elements
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
b8c6f29eb8
commit
622d241998
@ -736,7 +736,7 @@ void qmp_blockdev_group_snapshot_sync(SnapshotDevList *dev_list,
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
SnapshotDevList *dev_entry = dev_list;
|
SnapshotDevList *dev_entry = dev_list;
|
||||||
SnapshotDev *dev_info = NULL;
|
SnapshotDev *dev_info = NULL;
|
||||||
BlkGroupSnapshotStates *states;
|
BlkGroupSnapshotStates *states, *next;
|
||||||
BlockDriver *proto_drv;
|
BlockDriver *proto_drv;
|
||||||
BlockDriver *drv;
|
BlockDriver *drv;
|
||||||
int flags;
|
int flags;
|
||||||
@ -842,7 +842,7 @@ delete_and_fail:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit:
|
exit:
|
||||||
QSIMPLEQ_FOREACH(states, &snap_bdrv_states, entry) {
|
QSIMPLEQ_FOREACH_SAFE(states, &snap_bdrv_states, entry, next) {
|
||||||
g_free(states);
|
g_free(states);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user