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 ab7b851911ac239fc2143f3d7c17e71ace420e53..6d39e328e82581f01dd32316ac5214e6c18e581c 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;
 }