diff --git a/src/modules/dmq/dmq.c b/src/modules/dmq/dmq.c index 79cc8ccbc95..27e950e4725 100644 --- a/src/modules/dmq/dmq.c +++ b/src/modules/dmq/dmq.c @@ -387,6 +387,7 @@ static int dmq_add_notification_address(modparam_t type, void * val) } dmq_tmp_list = dmq_notification_address_list; dmq_tmp_list->s = tmp_str; + dmq_tmp_list->next = NULL; } else { dmq_tmp_list = append_str_list(tmp_str.s, tmp_str.len, &dmq_tmp_list, &total_list); if (dmq_tmp_list == NULL) { diff --git a/src/modules/dmq/notification_peer.c b/src/modules/dmq/notification_peer.c index ff8886d0ab4..d40fd2cac2e 100644 --- a/src/modules/dmq/notification_peer.c +++ b/src/modules/dmq/notification_peer.c @@ -284,7 +284,7 @@ dmq_node_t *add_server_and_notify(str_list_t *server_list) { char puri_data[MAXDMQHOSTS * (MAXDMQURILEN + 1)]; char *puri_list[MAXDMQHOSTS]; - dmq_node_t *pfirst, *pnode; + dmq_node_t *pfirst = NULL, *pnode = NULL; int host_cnt, index; sip_uri_t puri[1]; str pstr[1]; @@ -296,7 +296,7 @@ dmq_node_t *add_server_and_notify(str_list_t *server_list) **********/ if(!dmq_multi_notify) { - while (&server_list->s != NULL) { + while (server_list != NULL) { LM_DBG("adding notification node %.*s\n", server_list->s.len, server_list->s.s); pfirst = add_dmq_node(dmq_node_list, &server_list->s); @@ -592,6 +592,7 @@ int notification_resp_callback_f( { int ret; int nodes_recv; + str_list_t *slp; LM_DBG("notification_callback_f triggered [%p %d %p]\n", msg, code, param); if(code == 200) { @@ -605,15 +606,16 @@ int notification_resp_callback_f( } } else if(code == 408) { /* TODO this probably do not work for dmq_multi_notify */ - while (&dmq_notification_address_list->s != NULL) { - if(STR_EQ(node->orig_uri, dmq_notification_address_list->s)) { + slp = dmq_notification_address_list; + while (slp != NULL) { + if(STR_EQ(node->orig_uri, slp->s)) { LM_ERR("not deleting notification peer [%.*s]\n", - STR_FMT(&dmq_notification_address_list->s)); + STR_FMT(&slp->s)); update_dmq_node_status(dmq_node_list, node, DMQ_NODE_PENDING); return 0; } - dmq_notification_address_list = dmq_notification_address_list->next; - } + slp = slp->next; + } if (node->status == DMQ_NODE_DISABLED) { /* deleting node - the server did not respond */ LM_ERR("deleting server node %.*s because of failed request\n",