Skip to content

Commit

Permalink
tm: fix transaction leakage when receiving replicated CANCELs
Browse files Browse the repository at this point in the history
(cherry picked from commit 82b8d20)
  • Loading branch information
rvlad-patrascu committed Nov 20, 2020
1 parent 7112cf4 commit d48008a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion modules/tm/cluster.c
Expand Up @@ -36,6 +36,8 @@ static str tm_repl_cap = str_init("tm-repl");

struct clusterer_binds cluster_api;

int do_t_cleanup( struct sip_msg *req, void *bar);

#define TM_BIN_POP(_t, _f, _d) \
do { \
if (bin_pop_##_t(packet, _f) < 0) { \
Expand Down Expand Up @@ -142,7 +144,7 @@ static void tm_repl_cancel(bin_packet_t *packet, str *buf, struct receive_info *
tmp = ip_addr2a(&(ri->src_ip));
LM_ERR("Unable to parse replicated CANCEL received from [%s:%d]\n",
tmp, ri->src_port);
return;
goto cleanup;
}
}

Expand All @@ -152,6 +154,8 @@ static void tm_repl_cancel(bin_packet_t *packet, str *buf, struct receive_info *
else
LM_ERR("cannot handle auto-CANCEL for %p!\n", t);

cleanup:
do_t_cleanup(&msg, NULL);
free_sip_msg(&msg);
}

Expand Down
2 changes: 1 addition & 1 deletion modules/tm/tm.c
Expand Up @@ -667,7 +667,7 @@ int load_tm( struct tm_binds *tmb)
}


static int do_t_cleanup( struct sip_msg *req, void *bar)
int do_t_cleanup( struct sip_msg *req, void *bar)
{
struct cell *t;

Expand Down

0 comments on commit d48008a

Please sign in to comment.