Browse Source

tm: free struct contacts in case of error retrieving r-uri in t_load_contacts()

Daniel-Constantin Mierla 11 years ago
parent
commit
770434e87e
1 changed files with 2 additions and 0 deletions
  1. 2 0
      modules/tm/t_serial.c

+ 2 - 0
modules/tm/t_serial.c

@@ -197,10 +197,12 @@ int t_load_contacts(struct sip_msg* msg, char* key, char* value)
 		LM_ERR("no memory for contact info\n");
 		return -1;
 	}
+	memset(contact, 0, sizeof(struct contact));
 
 	if (ruri_is_new) {
 		ruri = GET_RURI(msg);
 		if (!ruri) {
+			free_contact_list(contacts);
 			LM_ERR("no Request-URI found\n");
 			return -1;
 		}