summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorqarmin <mikrutrafal54@gmail.com>2019-07-23 09:14:31 +0200
committerqarmin <mikrutrafal54@gmail.com>2019-07-23 09:14:31 +0200
commitaab8da25ad2c3e6d2df03abbc8e35c1725938c40 (patch)
treea98f3ddd124571378b146209beb308eb2768f9bc /modules
parente466dc2daa8eee7e6fb5a7fce40bf9e988a927cb (diff)
Fix some code found by Coverity Scan and PVS Studio
Diffstat (limited to 'modules')
-rw-r--r--modules/bullet/space_bullet.cpp4
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)));