Skip to content

Commit

Permalink
rtpproxy: Fix bad error handling on rare OOM case
Browse files Browse the repository at this point in the history
(cherry picked from commit d2cec34)
  • Loading branch information
liviuchircu committed Sep 5, 2022
1 parent 296c584 commit dc39450
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/rtpproxy/rtpproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,14 +1069,14 @@ mod_init(void)

rtpp_no = (unsigned int*)shm_malloc(sizeof(unsigned int));
list_version = (unsigned int*)shm_malloc(sizeof(unsigned int));
*rtpp_no = 0;
*list_version = 0;
my_version = 0;

if(!rtpp_no || !list_version) {
LM_ERR("No more shared memory\n");
return -1;
}
*rtpp_no = 0;
*list_version = 0;
my_version = 0;

if (!(rtpp_set_list = (struct rtpp_set_head **)
shm_malloc(sizeof(struct rtpp_set_head *)))) {
LM_ERR("no more shm mem\n");
Expand Down

0 comments on commit dc39450

Please sign in to comment.