Browse code

cdp: use same data type for size computing as pointer type

(cherry picked from commit 47169b6774759131e9e535f2b9d358772b777b9c)

Daniel-Constantin Mierla authored on 01/05/2022 14:28:41
Showing 1 changed files
... ...
@@ -79,12 +79,12 @@ void acceptor_process(dp_config *cfg)
79 79
 	unsigned int sock;
80 80
 
81 81
 	LM_INFO("Acceptor process starting up...\n");
82
-	listening_socks = pkg_malloc((cfg->acceptors_cnt+1)*sizeof(int));
82
+	listening_socks = pkg_malloc((cfg->acceptors_cnt+1)*sizeof(unsigned int));
83 83
 	if (!listening_socks){
84
-		LOG_NO_MEM("pkg",(cfg->acceptors_cnt+1)*sizeof(int));
84
+		LOG_NO_MEM("pkg",(cfg->acceptors_cnt+1)*sizeof(unsigned int));
85 85
 		goto done;
86 86
 	}
87
-	memset(listening_socks,0,(cfg->acceptors_cnt+1)*sizeof(int));
87
+	memset(listening_socks,0,(cfg->acceptors_cnt+1)*sizeof(unsigned int));
88 88
 	k=0;
89 89
 	for(i=0;i<cfg->acceptors_cnt;i++)
90 90
 		if (create_socket(cfg->acceptors[i].port,cfg->acceptors[i].bind,&sock)){