Fix for potential memory leak in Bullet API: freeing dynamic arrays
authorLukas Tönne <lukas.toenne@gmail.com>
Wed, 5 Mar 2014 09:00:46 +0000 (10:00 +0100)
committerLukas Tönne <lukas.toenne@gmail.com>
Wed, 5 Mar 2014 09:01:46 +0000 (10:01 +0100)
should use the delete[] operator instead of the plain pointer delete.

intern/rigidbody/rb_bullet_api.cpp

index ab7b851..6d39e32 100644 (file)
@@ -726,8 +726,8 @@ rbMeshData *RB_trimesh_data_new(int num_tris, int num_verts)
 static void RB_trimesh_data_delete(rbMeshData *mesh)
 {
        delete mesh->index_array;
-       delete mesh->vertices;
-       delete mesh->triangles;
+       delete[] mesh->vertices;
+       delete[] mesh->triangles;
        delete mesh;
 }