diff options
-rwxr-xr-x | source/blender/freestyle/intern/winged_edge/WEdge.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.cpp b/source/blender/freestyle/intern/winged_edge/WEdge.cpp index 1a3c9341374..31082e3376f 100755 --- a/source/blender/freestyle/intern/winged_edge/WEdge.cpp +++ b/source/blender/freestyle/intern/winged_edge/WEdge.cpp @@ -626,7 +626,12 @@ WFace* WShape::MakeFace(vector<WVertex*>& iVertexList, unsigned iMaterial) // allocate the new face WFace *face = instanciateFace(); - return MakeFace(iVertexList, iMaterial, face); + WFace *result = MakeFace(iVertexList, iMaterial, face); + if (0 == result) { + delete face; + return 0; + } + return result; } WFace * WShape::MakeFace(vector<WVertex*>& iVertexList, vector<Vec3r>& iNormalsList, vector<Vec2r>& iTexCoordsList, unsigned iMaterial) |