Browse code

rtpengine: use reallocxf() to handle realloc failure

Daniel-Constantin Mierla authored on 10/08/2017 10:15:36
Showing 1 changed files
... ...
@@ -671,7 +671,7 @@ static int rtpengine_set_store(modparam_t type, void * val){
671 671
 			return -1;
672 672
 		}
673 673
 	} else {/*realloc to make room for the current set*/
674
-		rtpp_strings = (char**)pkg_realloc(rtpp_strings, (rtpp_sets+1)* sizeof(char*));
674
+		rtpp_strings = (char**)pkg_reallocxf(rtpp_strings, (rtpp_sets+1)* sizeof(char*));
675 675
 		if(!rtpp_strings){
676 676
 			LM_ERR("no pkg memory left\n");
677 677
 			return -1;
... ...
@@ -1608,7 +1608,7 @@ static int build_rtpp_socks() {
1608 1608
 	}
1609 1609
 
1610 1610
 	rtpp_socks_size = current_rtpp_no;
1611
-	rtpp_socks = (int*)pkg_realloc(rtpp_socks, sizeof(int)*(rtpp_socks_size));
1611
+	rtpp_socks = (int*)pkg_reallocxf(rtpp_socks, sizeof(int)*(rtpp_socks_size));
1612 1612
 	if (!rtpp_socks) {
1613 1613
 		LM_ERR("no more pkg memory for rtpp_socks\n");
1614 1614
 		return -1;