Module: kamailio
Branch: 4.4
Commit: d4156e946e4ac99f968b8d065932a9d7570404ac
URL:
https://github.com/kamailio/kamailio/commit/d4156e946e4ac99f968b8d065932a9d…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: GitHub <noreply(a)github.com>
Date: 2017-01-18T08:42:44Z
kazoo: initialize pointers and return default zones
---
Modified: modules/kazoo/kz_amqp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d4156e946e4ac99f968b8d065932a9d…
Patch:
https://github.com/kamailio/kamailio/commit/d4156e946e4ac99f968b8d065932a9d…
---
diff --git a/modules/kazoo/kz_amqp.c b/modules/kazoo/kz_amqp.c
index e4c0779..feac047 100644
--- a/modules/kazoo/kz_amqp.c
+++ b/modules/kazoo/kz_amqp.c
@@ -424,6 +424,7 @@ kz_amqp_zone_ptr kz_amqp_get_primary_zone() {
strcpy(kz_primary_zone->zone, dbk_primary_zone_name.s);
kz_primary_zone->zone[dbk_primary_zone_name.len] = '\0';
kz_primary_zone->servers = (kz_amqp_servers_ptr)
shm_malloc(sizeof(kz_amqp_servers));
+ memset(kz_primary_zone->servers, 0, sizeof(kz_amqp_servers));
}
return kz_primary_zone;
}
@@ -448,6 +449,7 @@ kz_amqp_zone_ptr kz_amqp_add_zone(char* zone) {
kz_amqp_zone_ptr zone_ptr = (kz_amqp_zone_ptr) shm_malloc(sizeof(kz_amqp_zone));
memset(zone_ptr, 0, sizeof(kz_amqp_zone));
zone_ptr->zone = shm_malloc(strlen(zone)+1);
+ memset(zone_ptr->servers, 0, sizeof(kz_amqp_servers));
strcpy(zone_ptr->zone, zone);
zone_ptr->zone[strlen(zone)] = '\0';
zone_ptr->servers = (kz_amqp_servers_ptr) shm_malloc(sizeof(kz_amqp_servers));
@@ -657,7 +659,7 @@ int kz_amqp_add_connection(modparam_t type, void* val)
url = ++ptr;
} else {
- zone_ptr = kz_amqp_get_primary_zone();
+ zone_ptr = kz_amqp_get_zones();
}