]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
There sure are a lot of these in test_hs.c. CID 1301385
authorNick Mathewson <nickm@torproject.org>
Thu, 28 May 2015 17:17:24 +0000 (13:17 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 28 May 2015 17:17:24 +0000 (13:17 -0400)
src/test/test_hs.c

index 6008518ba2eeac9f86b467977f4d85f8c77a09f2..fc265bcabcd877b0eaf72e99633289ed4fa76735 100644 (file)
@@ -304,7 +304,7 @@ static void
 test_hs_rend_data(void *arg)
 {
   int rep;
-  rend_data_t *client = NULL;
+  rend_data_t *client = NULL, *client_dup = NULL;
   /* Binary format of a descriptor ID. */
   char desc_id[DIGEST_LEN];
   char client_cookie[REND_DESC_COOKIE_LEN];
@@ -340,7 +340,7 @@ test_hs_rend_data(void *arg)
   tt_int_op(tor_digest_is_zero(client->rend_cookie), ==, 1);
 
   /* Test dup(). */
-  rend_data_t *client_dup = rend_data_dup(client);
+  client_dup = rend_data_dup(client);
   tt_assert(client_dup);
   tt_int_op(client_dup->auth_type, ==, client->auth_type);
   tt_str_op(client_dup->onion_address, OP_EQ, client->onion_address);
@@ -359,7 +359,9 @@ test_hs_rend_data(void *arg)
   tt_int_op(tor_digest_is_zero(client_dup->rend_pk_digest), ==, 1);
   tt_int_op(tor_digest_is_zero(client_dup->rend_cookie), ==, 1);
   rend_data_free(client);
+  client = NULL;
   rend_data_free(client_dup);
+  client_dup = NULL;
 
   /* Reset state. */
   base32_decode(desc_id, sizeof(desc_id), STR_DESC_ID_BASE32,
@@ -431,6 +433,7 @@ test_hs_rend_data(void *arg)
   rend_data_free(service);
   rend_data_free(service_dup);
   rend_data_free(client);
+  rend_data_free(client_dup);
 }
 
 struct testcase_t hs_tests[] = {