From 12aed15948173c9b858f5bcc657985158ef6c9db Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Thu, 5 Mar 2020 17:00:57 +0200 Subject: Bugfix * src/pinger.c (hostping_from_seqno): Always unlock the host, no matter what the return. --- src/pinger.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pinger.c b/src/pinger.c index 65e8e6a..824bac1 100644 --- a/src/pinger.c +++ b/src/pinger.c @@ -982,6 +982,7 @@ hostping_from_seqno(int seq) host = seqidx[seq].host; if (host) { int n; + HOSTPING *orig = host; hostping_lock(host); n = seqidx[seq].ping_num; @@ -1001,6 +1002,8 @@ hostping_from_seqno(int seq) host->name, n, seq); host = NULL; } + if (!host) + hostping_unlock(orig); } else fatal("no host found for sequence number %d", seq); pthread_mutex_unlock(&seqno_mutex); -- cgit v1.2.1