summaryrefslogtreecommitdiff
path: root/lib/isc/stats.c
diff options
context:
space:
mode:
authorErwin Lansing <erwin@FreeBSD.org>2015-10-01 07:47:44 +0000
committerErwin Lansing <erwin@FreeBSD.org>2015-10-01 07:47:44 +0000
commitff14d03521a89636be959e65a21374951fe699ba (patch)
treef50c4271d12b6939db067758ade30df93a038a91 /lib/isc/stats.c
parentb04f5d3d3ff49c604e768add0cf35600b9eee074 (diff)
Notes
Diffstat (limited to 'lib/isc/stats.c')
-rw-r--r--lib/isc/stats.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/isc/stats.c b/lib/isc/stats.c
index 89e34b3780873..03d2a8a7d103d 100644
--- a/lib/isc/stats.c
+++ b/lib/isc/stats.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009, 2012, 2014 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2009, 2012, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -169,19 +169,22 @@ isc_stats_detach(isc_stats_t **statsp) {
LOCK(&stats->lock);
stats->references--;
- UNLOCK(&stats->lock);
if (stats->references == 0) {
isc_mem_put(stats->mctx, stats->copiedcounters,
sizeof(isc_stat_t) * stats->ncounters);
isc_mem_put(stats->mctx, stats->counters,
sizeof(isc_stat_t) * stats->ncounters);
+ UNLOCK(&stats->lock);
DESTROYLOCK(&stats->lock);
#ifdef ISC_RWLOCK_USEATOMIC
isc_rwlock_destroy(&stats->counterlock);
#endif
isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats));
+ return;
}
+
+ UNLOCK(&stats->lock);
}
int