aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2020-03-05 17:00:57 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2020-03-05 17:00:57 +0200
commit12aed15948173c9b858f5bcc657985158ef6c9db (patch)
tree5a80b376a0ab8588024f940512d3fc644fee3f92
parentd69e51f571a3277dff8d3d374521b5902e1a6e5c (diff)
downloadping903-12aed15948173c9b858f5bcc657985158ef6c9db.tar.gz
ping903-12aed15948173c9b858f5bcc657985158ef6c9db.tar.bz2
Bugfix
* src/pinger.c (hostping_from_seqno): Always unlock the host, no matter what the return.
-rw-r--r--src/pinger.c3
1 files changed, 3 insertions, 0 deletions
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);

Return to:

Send suggestions and report system problems to the System administrator.