[sr-dev] git:master:b2b7ec82: keepalive: check if the destinations list is initialized at runtime use

Daniel-Constantin Mierla miconda at gmail.com
Fri Feb 5 09:57:40 CET 2021


Module: kamailio
Branch: master
Commit: b2b7ec826055fd67ecf5ffb052afa609e0aa9e5b
URL: https://github.com/kamailio/kamailio/commit/b2b7ec826055fd67ecf5ffb052afa609e0aa9e5b

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-02-05T09:55:58+01:00

keepalive: check if the destinations list is initialized at runtime use

- do not initialize, because is no longer seen in all processes,
initialization must be done in mod init

---

Modified: src/modules/keepalive/keepalive_mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/b2b7ec826055fd67ecf5ffb052afa609e0aa9e5b.diff
Patch: https://github.com/kamailio/kamailio/commit/b2b7ec826055fd67ecf5ffb052afa609e0aa9e5b.patch

---

diff --git a/src/modules/keepalive/keepalive_mod.c b/src/modules/keepalive/keepalive_mod.c
index 37872b89b1..3146ee6fb8 100644
--- a/src/modules/keepalive/keepalive_mod.c
+++ b/src/modules/keepalive/keepalive_mod.c
@@ -201,8 +201,10 @@ static int w_add_destination(sip_msg_t *msg, char *uri, char *owner)
  */
 static int ki_add_destination(sip_msg_t *msg, str *uri, str *owner)
 {
-	if(ka_alloc_destinations_list() < 0)
+	if(ka_destinations_list == NULL) {
+		LM_ERR("destinations list not initialized\n");
 		return -1;
+	}
 
 	return ka_add_dest(uri, owner, 0, ka_ping_interval, 0, 0, 0);
 }




More information about the sr-dev mailing list