Module: kamailio
Branch: master
Commit: 7dd5340911a5699997dac4cee50fccc944396253
URL:
https://github.com/kamailio/kamailio/commit/7dd5340911a5699997dac4cee50fccc…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: GitHub <noreply(a)github.com>
Date: 2017-01-18T09:33:55Z
kazoo: fix kz_amqp_get_zones
---
Modified: src/modules/kazoo/kz_amqp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7dd5340911a5699997dac4cee50fccc…
Patch:
https://github.com/kamailio/kamailio/commit/7dd5340911a5699997dac4cee50fccc…
---
diff --git a/src/modules/kazoo/kz_amqp.c b/src/modules/kazoo/kz_amqp.c
index 61e3e3e..9c802aa 100644
--- a/src/modules/kazoo/kz_amqp.c
+++ b/src/modules/kazoo/kz_amqp.c
@@ -452,6 +452,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;
}
@@ -479,6 +480,7 @@ kz_amqp_zone_ptr kz_amqp_add_zone(char* zone) {
strcpy(zone_ptr->zone, zone);
zone_ptr->zone[strlen(zone)] = '\0';
zone_ptr->servers = (kz_amqp_servers_ptr) shm_malloc(sizeof(kz_amqp_servers));
+ memset(zone_ptr->servers, 0, sizeof(kz_amqp_servers));
kz_zones->tail->next = zone_ptr;
kz_zones->tail = zone_ptr;
return zone_ptr;
@@ -685,7 +687,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();
}