Module: kamailio
Branch: master
Commit: b29a45f0a23ef0f1a26598a45d3e6eddc9dbedb5
URL:
https://github.com/kamailio/kamailio/commit/b29a45f0a23ef0f1a26598a45d3e6ed…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-01-08T16:00:47+01:00
dmq: be sure dmq_init_callback_done is initialized before accessing it
---
Modified: modules/dmq/notification_peer.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b29a45f0a23ef0f1a26598a45d3e6ed…
Patch:
https://github.com/kamailio/kamailio/commit/b29a45f0a23ef0f1a26598a45d3e6ed…
---
diff --git a/modules/dmq/notification_peer.c b/modules/dmq/notification_peer.c
index b493717..2e87c77 100644
--- a/modules/dmq/notification_peer.c
+++ b/modules/dmq/notification_peer.c
@@ -29,7 +29,7 @@
str notification_content_type = str_init("text/plain");
dmq_resp_cback_t notification_callback = {¬ification_resp_callback_f, 0};
-int *dmq_init_callback_done;
+int *dmq_init_callback_done = 0;
/**
@@ -229,7 +229,7 @@ int dmq_notification_callback(struct sip_msg* msg, peer_reponse_t*
resp, dmq_nod
¬ification_callback, maxforwards, ¬ification_content_type);
}
pkg_free(response_body);
- if (!*dmq_init_callback_done) {
+ if (dmq_init_callback_done && !*dmq_init_callback_done) {
*dmq_init_callback_done = 1;
run_init_callbacks();
}
@@ -325,7 +325,7 @@ int notification_resp_callback_f(struct sip_msg* msg, int code,
if(code == 200) {
nodes_recv = extract_node_list(node_list, msg);
LM_DBG("received %d new or changed nodes\n", nodes_recv);
- if (!*dmq_init_callback_done) {
+ if (dmq_init_callback_done && !*dmq_init_callback_done) {
*dmq_init_callback_done = 1;
run_init_callbacks();
}