Explorar o código

Fix coverity cid 1405509

Locking in the init function is not necessary, but coverity gets
confused about it. So let's trick it.
Sebastian Hahn %!s(int64=8) %!d(string=hai) anos
pai
achega
71c8974af0
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/common/compat_threads.c

+ 1 - 1
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