diff options
author | qarmin <mikrutrafal54@gmail.com> | 2019-07-23 09:14:31 +0200 |
---|---|---|
committer | qarmin <mikrutrafal54@gmail.com> | 2019-07-23 09:14:31 +0200 |
commit | aab8da25ad2c3e6d2df03abbc8e35c1725938c40 (patch) | |
tree | a98f3ddd124571378b146209beb308eb2768f9bc /modules | |
parent | e466dc2daa8eee7e6fb5a7fce40bf9e988a927cb (diff) |
Fix some code found by Coverity Scan and PVS Studio
Diffstat (limited to 'modules')
-rw-r--r-- | modules/bullet/space_bullet.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp index 738b415d16..9d632aaf83 100644 --- a/modules/bullet/space_bullet.cpp +++ b/modules/bullet/space_bullet.cpp @@ -581,6 +581,10 @@ void SpaceBullet::create_empty_world(bool p_create_soft_world) { } else { world_mem = malloc(sizeof(btDiscreteDynamicsWorld)); } + if (!world_mem) { + ERR_EXPLAIN("Out of memory"); + ERR_FAIL(); + } if (p_create_soft_world) { collisionConfiguration = bulletnew(GodotSoftCollisionConfiguration(static_cast<btDiscreteDynamicsWorld *>(world_mem))); |