Browse Source

tm: clean contacts in case of failure in t_load_contacts()

Daniel-Constantin Mierla 11 năm trước cách đây
mục cha
commit
09ebe81a4c
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      modules/tm/t_serial.c

+ 1 - 0
modules/tm/t_serial.c

@@ -309,6 +309,7 @@ int t_load_contacts(struct sip_msg* msg, char* key, char* value)
 			len = MAX_SOCKET_STR - 1;
 			if (socket2str(sock_buf, &len, curr->sock) < 0) {
 				LM_ERR("failed to convert socket to str\n");
+				free_contact_list(contacts);
 				return -1;
 			}
 			sock_buf[len] = 0;