Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-03-18 07:03:42 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-03-18 07:08:12 +0300
commita51fdd89fdd07015c0beb4cffec39f34e8a96d25 (patch)
tree5a4a3667423608a688766f1079b9f4c613dad87d /source
parent2aa0bde3dc286683013d9a2849630568bb99385d (diff)
Cleanup: use MEM_SAFE_FREE
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/mesh/meshtools.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index 73413bcbaad..d3d29b61182 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -552,12 +552,10 @@ int join_mesh_exec(bContext *C, wmOperator *op)
if (ma)
id_us_min(&ma->id);
}
- if (ob->mat) MEM_freeN(ob->mat);
- if (ob->matbits) MEM_freeN(ob->matbits);
- if (me->mat) MEM_freeN(me->mat);
- ob->mat = me->mat = NULL;
- ob->matbits = NULL;
-
+ MEM_SAFE_FREE(ob->mat);
+ MEM_SAFE_FREE(ob->matbits);
+ MEM_SAFE_FREE(me->mat);
+
if (totcol) {
me->mat = matar;
ob->mat = MEM_callocN(sizeof(*ob->mat) * totcol, "join obmatar");