ephysics - Dereference after null check - fix
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Mon, 1 Sep 2014 10:25:39 +0000 (19:25 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Mon, 1 Sep 2014 10:40:47 +0000 (19:40 +0900)
fix CID 1039416

src/lib/ephysics/ephysics_body.cpp

index 34719383bb4246c2248d40ae490dbecc45855779..c649506f7c016aab43cd9ac7fabac702dd4e7b13 100644 (file)
@@ -2972,7 +2972,7 @@ EAPI EPhysics_Body *
 ephysics_body_soft_box_add(EPhysics_World *world)
 {
    EPhysics_Body *body;
-   EPhysics_Body_Face_Slice *face_slice;
+   EPhysics_Body_Face_Slice *face_slice = NULL;
    btCollisionShape *shape;
    btSoftBodyWorldInfo *world_info;
    btSoftBody *soft_body;
@@ -3046,7 +3046,7 @@ ephysics_body_soft_box_add(EPhysics_World *world)
 
 no_slices:
 no_face_slice:
-   _ephysics_body_face_slice_del(face_slice);
+   if (face_slice) _ephysics_body_face_slice_del(face_slice);
 no_deform:
    ephysics_world_body_del(world, body);
 no_body: