Skip to content

Commit

Permalink
dialog replication: Fix a re-INVITE pinging shm leak
Browse files Browse the repository at this point in the history
In commit 65a9f51, we must make sure not to overwrite any already
existing SDP/contact pointers in each leg.
  • Loading branch information
liviuchircu committed Jul 30, 2019
1 parent 3b1c49f commit 66f3d97
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/dialog/dlg_db_handler.c
Expand Up @@ -1307,7 +1307,7 @@ int restore_reinvite_pinging(struct dlg_cell *dlg)
LM_ERR("failed to fetch caller advertised SDP\n");
ret = -1;
} else {
if (shm_str_dup(&dlg->legs[DLG_CALLER_LEG].adv_sdp, &out_buf) != 0) {
if (shm_str_sync(&dlg->legs[DLG_CALLER_LEG].adv_sdp, &out_buf) != 0) {
LM_ERR("oom\n");
ret = -1;
}
Expand All @@ -1317,7 +1317,7 @@ int restore_reinvite_pinging(struct dlg_cell *dlg)
LM_ERR("failed to fetch caller advertised Contact\n");
ret = -1;
} else {
if (shm_str_dup(&dlg->legs[DLG_CALLER_LEG].adv_contact,
if (shm_str_sync(&dlg->legs[DLG_CALLER_LEG].adv_contact,
&out_buf) != 0) {
LM_ERR("oom\n");
ret = -1;
Expand All @@ -1328,7 +1328,7 @@ int restore_reinvite_pinging(struct dlg_cell *dlg)
LM_ERR("failed to fetch callee advertised SDP\n");
ret = -1;
} else {
if (shm_str_dup(&dlg->legs[DLG_FIRST_CALLEE_LEG].adv_sdp, &out_buf) != 0) {
if (shm_str_sync(&dlg->legs[DLG_FIRST_CALLEE_LEG].adv_sdp, &out_buf) != 0) {
LM_ERR("oom\n");
ret = -1;
}
Expand All @@ -1338,7 +1338,7 @@ int restore_reinvite_pinging(struct dlg_cell *dlg)
LM_ERR("failed to fetch callee advertised Contact\n");
ret = -1;
} else {
if (shm_str_dup(&dlg->legs[DLG_FIRST_CALLEE_LEG].adv_contact,
if (shm_str_sync(&dlg->legs[DLG_FIRST_CALLEE_LEG].adv_contact,
&out_buf) != 0) {
LM_ERR("oom\n");
ret = -1;
Expand Down

0 comments on commit 66f3d97

Please sign in to comment.