ephysics - fix null dereference
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 22 Aug 2014 10:49:38 +0000 (19:49 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 22 Aug 2014 11:14:59 +0000 (20:14 +0900)
this fixes a real bug in ephysics where we explicitly deref a null
ponter. fix CID 1039418

src/lib/ephysics/ephysics_body.cpp

index e7cb00d..48ef8cf 100644 (file)
@@ -2122,13 +2122,7 @@ _ephysics_body_soft_body_add(EPhysics_World *world, btCollisionShape *collision_
 
    body = _ephysics_body_rigid_body_add(world, collision_shape, "soft box", 0.5,
                                         0.5, 0.5);
-   if (!body)
-     {
-        if (body->deleted) return NULL;
-        body->deleted = EINA_TRUE;
-        ephysics_world_body_del(body->world, body);
-        return NULL;
-     }
+   if (!body) return NULL;
 
    body->material_index = 0;
    body->type = EPHYSICS_BODY_TYPE_SOFT;