diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-07-16 20:03:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-07-16 20:03:22 +0300 |
commit | a40073ffccc49689e212c010996fc231dc8e46af (patch) | |
tree | e2314767b03ee8999927cab3297b1cc509d442d3 /source/blender/blenkernel | |
parent | c885cea7bbfbbb8f1815cf5bc1f3ecc532c309ad (diff) |
Fix use after free error from ab993e37
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index ea9fa57f905..b2f57328df3 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -2224,7 +2224,6 @@ Mesh *BKE_mesh_new_from_object( { Mesh *tmpmesh; Curve *tmpcu = NULL, *copycu; - Object *tmpobj = NULL; int render = settings == eModifierMode_Render, i; int cage = !apply_modifiers; @@ -2239,7 +2238,7 @@ Mesh *BKE_mesh_new_from_object( int uv_from_orco; /* copies object and modifiers (but not the data) */ - tmpobj = BKE_object_copy_ex(bmain, ob, true); + Object *tmpobj = BKE_object_copy_ex(bmain, ob, true); tmpcu = (Curve *)tmpobj->data; id_us_min(&tmpcu->id); @@ -2440,7 +2439,7 @@ Mesh *BKE_mesh_new_from_object( } /* make sure materials get updated in object */ - test_object_materials(tmpobj ? tmpobj : ob, &tmpmesh->id); + test_object_materials(ob, &tmpmesh->id); return tmpmesh; } |