_resolv_unlink_resolution(srv->resolv_requester);
HA_SPIN_LOCK(SERVER_LOCK, &srv->lock);
srvrq_set_srv_down(srv);
+
+ ebpt_delete(&srv->host_dn);
+ srv->host_dn.key = NULL;
+
ha_free(&srv->hostname);
ha_free(&srv->hostname_dn);
srv->hostname_dn_len = 0;
server_set_inetaddr(srv, &srv_addr, SERVER_INETADDR_UPDATER_NONE, NULL);
srv->flags |= SRV_F_NO_RESOLUTION;
- ebpt_delete(&srv->host_dn);
- ha_free(&srv->host_dn.key);
-
HA_SPIN_UNLOCK(SERVER_LOCK, &srv->lock);
LIST_DEL_INIT(&srv->srv_rec_item);
LIST_APPEND(&srv->srvrq->attached_servers, &srv->srv_rec_item);
if (srv->svc_port == item->port) {
/* server found, we remove it from tree */
ebpt_delete(node);
- ha_free(&srv->host_dn.key);
+ srv->host_dn.key = NULL;
goto srv_found;
}
* since this server has an hostname
*/
LIST_DEL_INIT(&srv->srv_rec_item);
- srv->host_dn.key = strdup(srv->hostname_dn);
+ srv->host_dn.key = srv->hostname_dn;
/* insert in tree and set the srvrq expiration date */
ebis_insert(&srv->srvrq->named_servers, &srv->host_dn);