diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-31 04:35:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-31 04:35:40 +0300 |
commit | 5afc247ea183488f6b5cd22f659a21e87a68ddbb (patch) | |
tree | d091cf80f14c39ee56ff28d8369d23ed0fe0e624 | |
parent | 8c89790674901748cf04771dc2c5453815db1607 (diff) |
Fix image paint undo memory leak
-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); } } |