Skip to content

Commit

Permalink
rtpengine: allocate space for one more rtp relay control socket
Browse files Browse the repository at this point in the history
- keep it as safety end place holder
- should make it work again for the case when starting with no rtp
engine in the database - GH #1940

(cherry picked from commit c836f8b)
  • Loading branch information
miconda committed May 16, 2019
1 parent b7b1169 commit 1f4262b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modules/rtpengine/rtpengine.c
Expand Up @@ -1717,12 +1717,13 @@ static int build_rtpp_socks(int lmode, int rtest) {
}

rtpp_socks_size = current_rtpp_no;
rtpp_socks = (int*)pkg_reallocxf(rtpp_socks, sizeof(int)*(rtpp_socks_size));
/* allocate one more to have a safety end place holder */
rtpp_socks = (int*)pkg_reallocxf(rtpp_socks, sizeof(int)*(rtpp_socks_size+1));
if (!rtpp_socks) {
LM_ERR("no more pkg memory for rtpp_socks\n");
return -1;
}
memset(rtpp_socks, -1, sizeof(int)*(rtpp_socks_size));
memset(rtpp_socks, -1, sizeof(int)*(rtpp_socks_size+1));

rtpe_reload_lock_get(rtpp_set_list->rset_head_lock);
_rtpe_list_vernum_local = _rtpe_list_version->vernum;
Expand Down

0 comments on commit 1f4262b

Please sign in to comment.