summaryrefslogtreecommitdiff
path: root/src/common/compat_threads.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2017-04-26 08:48:24 +0200
committerSebastian Hahn <sebastian@torproject.org>2017-04-26 08:48:24 +0200
commit71c8974af0570f3a2fe1ea5ca77e3a61873558bd (patch)
treea5f6642d5f03ff91a0df844cdd1456226cc206a8 /src/common/compat_threads.c
parentee478bdf385b052783c2edfb1b21dc500cf0d9d5 (diff)
downloadtor-71c8974af0570f3a2fe1ea5ca77e3a61873558bd.tar.gz
tor-71c8974af0570f3a2fe1ea5ca77e3a61873558bd.zip
Fix coverity cid 1405509
Locking in the init function is not necessary, but coverity gets confused about it. So let's trick it.
Diffstat (limited to 'src/common/compat_threads.c')
-rw-r--r--src/common/compat_threads.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/compat_threads.c b/src/common/compat_threads.c
index d3f64f2bad..c593e9af8d 100644
--- a/src/common/compat_threads.c
+++ b/src/common/compat_threads.c
@@ -362,8 +362,8 @@ alert_sockets_close(alert_sockets_t *socks)
void
atomic_counter_init(atomic_counter_t *counter)
{
+ memset(counter, 0, sizeof(*counter));
tor_mutex_init_nonrecursive(&counter->mutex);
- counter->val = 0;
}
/** Clean up all resources held by an atomic counter. */
void