Skip to content

Commit

Permalink
b2b_logic: prevent crash in case a bridging is in progress
Browse files Browse the repository at this point in the history
(cherry picked from commit c69201e)
  • Loading branch information
razvancrainea committed Sep 20, 2024
1 parent e982e90 commit 377c11b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions modules/b2b_logic/bridging.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,17 @@ mi_response_t *mi_b2b_bridge(const mi_params_t *params,
goto error;
}

if (old_entity->peer->peer == old_entity)
old_entity->peer->peer = NULL;
else
{
LM_ERR("Unexpected chain: old_entity=[%p] and old_entity->peer->peer=[%p]\n",
old_entity, old_entity->peer->peer);
goto error;
if (old_entity->peer) {
if (old_entity->peer->peer == old_entity)
old_entity->peer->peer = NULL;
else
{
LM_ERR("Unexpected chain: old_entity=[%p] and old_entity->peer->peer=[%p]\n",
old_entity, old_entity->peer->peer);
goto error;
}
old_entity->peer = NULL;
}
old_entity->peer = NULL;

tuple->bridge_entities[0]= bridging_entity;

Expand Down

0 comments on commit 377c11b

Please sign in to comment.