diff options
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_undo.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_undo.c b/source/blender/editors/sculpt_paint/paint_image_undo.c index 25f5d91a928..0cf56726abf 100644 --- a/source/blender/editors/sculpt_paint/paint_image_undo.c +++ b/source/blender/editors/sculpt_paint/paint_image_undo.c @@ -346,10 +346,10 @@ static void image_undo_restore_list(ListBase *lb, struct UndoIDPtrMap *id_map) static void image_undo_free_list(ListBase *lb) { - UndoImageTile *tile; - - for (tile = lb->first; tile; tile = tile->next) { + for (UndoImageTile *tile = lb->first, *tile_next; tile; tile = tile_next) { + tile_next = tile->next; MEM_freeN(tile->rect.pt); + MEM_freeN(tile); } } |