Module: kamailio Branch: 4.2 Commit: edbed4cc15a250e4b7c12d3d322b8a6575582c21 URL: https://github.com/kamailio/kamailio/commit/edbed4cc15a250e4b7c12d3d322b8a6575582c21
Author: Daniel-Constantin Mierla <mico...@gmail.com> Committer: Daniel-Constantin Mierla <mico...@gmail.com> Date: 2015-01-08T16:02:31+01:00 dmq: be sure dmq_init_callback_done is initialized before accessing it (cherry picked from commit b29a45f0a23ef0f1a26598a45d3e6eddc9dbedb5) --- Modified: modules/dmq/notification_peer.c --- Diff: https://github.com/kamailio/kamailio/commit/edbed4cc15a250e4b7c12d3d322b8a6575582c21.diff Patch: https://github.com/kamailio/kamailio/commit/edbed4cc15a250e4b7c12d3d322b8a6575582c21.patch --- 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(); } _______________________________________________ sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev