diff --git a/src/viced/host.c b/src/viced/host.c index df94db09b1..38c1265152 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -2205,9 +2205,9 @@ CheckHost(register struct host *host, int held) } if (host->LastCall < checktime) { h_Lock_r(host); - cb_conn = host->callback_rxcon; - rx_GetConnection(cb_conn); if (!(host->hostFlags & HOSTDELETED)) { + cb_conn = host->callback_rxcon; + rx_GetConnection(cb_conn); if (host->LastCall < clientdeletetime) { host->hostFlags |= HOSTDELETED; if (!(host->hostFlags & VENUSDOWN)) { @@ -2272,11 +2272,11 @@ CheckHost(register struct host *host, int held) } } } + H_UNLOCK; + rx_PutConnection(cb_conn); + cb_conn=NULL; + H_LOCK; } - H_UNLOCK; - rx_PutConnection(cb_conn); - cb_conn=NULL; - H_LOCK; h_Unlock_r(host); } H_UNLOCK;