Skip to content

Commit

Permalink
b2b_entitites: do not unref cancelled cell if not ours
Browse files Browse the repository at this point in the history
If a CANCEL is caught by the b2b_entities but it is not part of a b2b
dialog, it should not unref the cell, otherwise after the script is
executed, it will be unreffed again, leading to a double unref.

Many thanks to Voxtronic for spotting this issue!
  • Loading branch information
razvancrainea committed Sep 13, 2024
1 parent 9a3caec commit c7780db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/b2b_entities/dlg.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,13 +885,14 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam)
*/
dlg = b2bl_search_iteratively(&callid, &from_tag, T_invite,
hash_index);
tmb.unref_cell( T_invite );
if(dlg == NULL)
{
B2BE_LOCK_RELEASE(server_htable, hash_index);
LM_DBG("No dialog found for cancel\n");
return SCB_RUN_ALL;
}
tmb.unref_cell( T_invite );
reset_cancelled_t();

ctx = b2b_get_context();
if (!ctx) {
Expand Down

0 comments on commit c7780db

Please sign in to comment.