Skip to content

Commit f103dd4

Browse files
authored
Merge pull request #2044 from l2dy/rtpengine
rtpengine: check NULL before assignment
2 parents 962ba07 + f33f1d8 commit f103dd4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/rtpengine/rtpengine.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,15 +1232,16 @@ mod_init(void)
12321232

12331233
rtpe_no = (unsigned int*)shm_malloc(sizeof(unsigned int));
12341234
list_version = (unsigned int*)shm_malloc(sizeof(unsigned int));
1235-
*rtpe_no = 0;
1236-
*list_version = 0;
1237-
my_version = 0;
12381235

12391236
if(!rtpe_no || !list_version) {
12401237
LM_ERR("No more shared memory\n");
12411238
return -1;
12421239
}
12431240

1241+
*rtpe_no = 0;
1242+
*list_version = 0;
1243+
my_version = 0;
1244+
12441245
if (!(rtpe_set_list = (struct rtpe_set_head **)
12451246
shm_malloc(sizeof(struct rtpe_set_head *)))) {
12461247
LM_ERR("no more shm mem\n");

0 commit comments

Comments
 (0)