]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Small cleanups to test_entry_is_time_to_retry
authorNick Mathewson <nickm@torproject.org>
Wed, 20 Aug 2014 19:31:25 +0000 (15:31 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 20 Aug 2014 19:31:25 +0000 (15:31 -0400)
src/test/test_entrynodes.c

index 5fee0336da798d901d6cfd3c97c9f3b9c1631829..bf014f1a9d0eea5f9fe72d67f02924fc11484048 100644 (file)
@@ -541,16 +541,14 @@ test_entry_guards_set_from_config(void *arg)
 static void
 test_entry_is_time_to_retry(void *arg)
 {
-  (void)arg;
-
   entry_guard_t *test_guard;
   time_t now;
   int retval;
+  (void)arg;
 
   now = time(NULL);
 
-  test_guard = tor_malloc(sizeof(entry_guard_t));
-  memset(test_guard,0,sizeof(entry_guard_t));
+  test_guard = tor_malloc_zero(sizeof(entry_guard_t));
 
   test_guard->last_attempted = now - 10;
   test_guard->unreachable_since = now - 1;
@@ -610,9 +608,8 @@ test_entry_is_time_to_retry(void *arg)
   retval = entry_is_time_to_retry(test_guard,now);
   tt_int_op(retval,==,1);
 
 done:
+ done:
   tor_free(test_guard);
-  return;
 }
 
 /** XXX Do some tests that entry_is_live() */