From b5692511105cddd812e687259740d2a6fa240219 Mon Sep 17 00:00:00 2001 From: Alexander Alekseev Date: Mon, 2 Apr 2018 09:29:34 +0300 Subject: [PATCH] Fix of a possible memory leak: ConcavePolygonShapeBullet::setup was able to exit without releasing the 'shapeInterface' pointer. --- modules/bullet/shape_bullet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp index 5d8d391bd99..9cbf83689ba 100644 --- a/modules/bullet/shape_bullet.cpp +++ b/modules/bullet/shape_bullet.cpp @@ -337,10 +337,10 @@ void ConcavePolygonShapeBullet::setup(PoolVector p_faces) { int src_face_count = faces.size(); if (0 < src_face_count) { - btTriangleMesh *shapeInterface = bulletnew(btTriangleMesh); - // It counts the faces and assert the array contains the correct number of vertices. ERR_FAIL_COND(src_face_count % 3); + + btTriangleMesh *shapeInterface = bulletnew(btTriangleMesh); src_face_count /= 3; PoolVector::Read r = p_faces.read(); const Vector3 *facesr = r.ptr();