Commit: b3f08cddf3ec69275d4ac9d843a1d96d8713f93d Author: Campbell Barton Date: Fri Apr 1 05:42:15 2016 +1100 Branches: blender-v2.77-release https://developer.blender.org/rBb3f08cddf3ec69275d4ac9d843a1d96d8713f93d
Fix NULL check before free =================================================================== M source/blender/editors/mesh/editmesh_knife.c =================================================================== diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 59967ff..9480755 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -2276,12 +2276,8 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe KnifeEdge *kfe; Ref *ref; int edge_array_len = BLI_listbase_count(kfedges); - bool ok; int i; - BMFace **face_arr; - int face_arr_len; - BMEdge **edge_array = BLI_array_alloca(edge_array, edge_array_len); /* point to knife edges we've created edges in, edge_array aligned */ @@ -2357,12 +2353,17 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe } #endif - ok = BM_face_split_edgenet( - bm, f, edge_array, edge_array_len, - &face_arr, &face_arr_len); + { + BMFace **face_arr = NULL; + int face_arr_len; + + BM_face_split_edgenet( + bm, f, edge_array, edge_array_len, + &face_arr, &face_arr_len); - if (ok) { - MEM_freeN(face_arr); + if (face_arr) { + MEM_freeN(face_arr); + } } /* remove dangling edges, not essential - but nice for users */ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs