2
0
Эх сурвалжийг харах

Merge branch 'master' of ssh://git.sip-router.org/sip-router

Marius Bucur 14 жил өмнө
parent
commit
9cf0858d00

+ 2 - 0
lib/srdb1/db_id.c

@@ -207,12 +207,14 @@ static int parse_db_url(struct db_id* id, const str* url)
 	return 0;
 
  err:
+	if (!id) goto end;
 	if (id->scheme) pkg_free(id->scheme);
 	if (id->username) pkg_free(id->username);
 	if (id->password) pkg_free(id->password);
 	if (id->host) pkg_free(id->host);
 	if (id->database) pkg_free(id->database);
 	if (prev_token) pkg_free(prev_token);
+ end:
 	return -1;
 }
 

+ 1 - 0
modules_k/mi_datagram/datagram_fnc.c

@@ -335,6 +335,7 @@ static void datagram_close_async(struct mi_root *mi_rpl,struct mi_handler *hdl,
 
 	mi_create_dtgram_replysocket(reply_sock, p->domain, err);
 
+        memset(&dtgram, 0, sizeof(dtgram));
 
 	if (mi_rpl!=0) {
 		/*allocate the response datagram*/	

+ 4 - 4
modules_k/snmpstats/snmpstats.c

@@ -195,10 +195,10 @@ static int register_message_code_statistics(void)
 		sizeof(in_message_code_names) / sizeof(char *);
 
 	in_message_code_stats = 
-		shm_malloc(sizeof(stat_var) * number_of_message_codes);
+		shm_malloc(sizeof(stat_var*) * number_of_message_codes);
 
 	out_message_code_stats = 
-		shm_malloc(sizeof(stat_var) * number_of_message_codes);
+		shm_malloc(sizeof(stat_var*) * number_of_message_codes);
 
 	/* We can only proceed if we had enough memory to allocate the
 	 * statistics.  Note that we don't free the memory, but we don't care
@@ -210,8 +210,8 @@ static int register_message_code_statistics(void)
 	}
 
 	/* Make sure everything is zeroed out */
-	memset(in_message_code_stats,  0, number_of_message_codes);
-	memset(out_message_code_stats, 0, number_of_message_codes);
+	memset(in_message_code_stats,  0, sizeof(stat_var*) * number_of_message_codes);
+	memset(out_message_code_stats, 0, sizeof(stat_var*) * number_of_message_codes);
 
 	for (i = 0; i < number_of_message_codes; i++) 
 	{

+ 1 - 1
modules_s/registrar/save.c

@@ -281,7 +281,7 @@ int parse_uri_dstip(str* received, struct ip_addr* ip, unsigned short* port,
 	struct sip_uri puri;
 	param_hooks_t hooks;
 	struct ip_addr* p;
-	param_t* params;
+	param_t* params = 0;
 	int error;
 
 	if (unlikely(!received)) return 0;

+ 1 - 1
route.c

@@ -1754,7 +1754,7 @@ inline static int comp_ip(int op, struct ip_addr* ip, int rtype,
 		default:
 			LOG(L_CRIT, "BUG: comp_ip: invalid type for "
 						" src_ip or dst_ip (%d)\n", rtype);
-			ret=-1;
+			return -1;
 	}
 	/* here "right" is set to the str we compare with */
 	r_expop.str=*right;