From 5afc247ea183488f6b5cd22f659a21e87a68ddbb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 31 Jan 2019 12:35:12 +1100 Subject: Fix image paint undo memory leak --- source/blender/editors/sculpt_paint/paint_image_undo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender') 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); } } -- cgit v1.2.3