Module: kamailio
Branch: master
Commit: 4d52cc0556d2e9cf334aca89325589f1c86b4dc7
URL:
https://github.com/kamailio/kamailio/commit/4d52cc0556d2e9cf334aca89325589f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-01-08T17:15:19+01:00
dmq: more initialization of pointers at declaration of vars
---
Modified: modules/dmq/dmq.c
Modified: modules/dmq/notification_peer.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4d52cc0556d2e9cf334aca89325589f…
Patch:
https://github.com/kamailio/kamailio/commit/4d52cc0556d2e9cf334aca89325589f…
---
diff --git a/modules/dmq/dmq.c b/modules/dmq/dmq.c
index c17607a..7df28a3 100644
--- a/modules/dmq/dmq.c
+++ b/modules/dmq/dmq.c
@@ -75,12 +75,12 @@ sl_api_t slb;
/** module variables */
str dmq_request_method = str_init("KDMQ");
-dmq_worker_t* workers;
+dmq_worker_t* workers = NULL;
dmq_peer_list_t* peer_list = 0;
/* the list of dmq servers */
-dmq_node_list_t* node_list;
+dmq_node_list_t* node_list = NULL;
// the dmq module is a peer itself for receiving notifications regarding nodes
-dmq_peer_t* dmq_notification_peer;
+dmq_peer_t* dmq_notification_peer = NULL;
/** module functions */
static int mod_init(void);
diff --git a/modules/dmq/notification_peer.c b/modules/dmq/notification_peer.c
index 2e87c77..ae92e82 100644
--- a/modules/dmq/notification_peer.c
+++ b/modules/dmq/notification_peer.c
@@ -38,6 +38,8 @@ int *dmq_init_callback_done = 0;
int add_notification_peer()
{
dmq_peer_t not_peer;
+
+ memset(¬_peer, 0, sizeof(dmq_peer_t));
not_peer.callback = dmq_notification_callback;
not_peer.init_callback = NULL;
not_peer.description.s = "notification_peer";