fix jump to NULL
authorPhilipp Tölke <toelke@in.tum.de>
Thu, 24 Feb 2011 14:20:22 +0000 (14:20 +0000)
committerPhilipp Tölke <toelke@in.tum.de>
Thu, 24 Feb 2011 14:20:22 +0000 (14:20 +0000)
src/mesh/mesh_api.c

index 82fb75c5128a959f8b47be9bba43470b2a158401..3421e2c6f7ad39b4756ed3ef8735e20e0f49b085 100644 (file)
@@ -226,11 +226,11 @@ core_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
        {
          /* disconnect tunnels */
          /* outbound tunnels */
-         if (telement->tunnel.connect_handler != NULL)
+         if (telement->tunnel.connect_handler != NULL && NULL != telement->tunnel.disconnect_handler)
            telement->tunnel.disconnect_handler (telement->tunnel.handler_cls,
                                                 peer);
          /* inbound tunnels */
-         else
+         else if (NULL != handle->cleaner)
            handle->cleaner (handle->cls, &telement->tunnel,
                             &telement->tunnel.ctx);