test: Fix memory leak in test_hs_common.c

Partially fixes #23223

Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
David Goulet 2017-08-11 14:46:27 -04:00
parent 60c7da71ab
commit 9df4261407

View File

@ -409,7 +409,7 @@ test_responsible_hsdirs(void *arg)
memset(&ri, 0 ,sizeof(routerinfo_t)); memset(&ri, 0 ,sizeof(routerinfo_t));
tor_addr_parse(&ipv4_addr, "127.0.0.1"); tor_addr_parse(&ipv4_addr, "127.0.0.1");
ri.addr = tor_addr_to_ipv4h(&ipv4_addr); ri.addr = tor_addr_to_ipv4h(&ipv4_addr);
ri.nickname = tor_strdup("fatal"); ri.nickname = (char *) "fatal";
ri.protocol_list = (char *) "HSDir=1-2 LinkAuth=3"; ri.protocol_list = (char *) "HSDir=1-2 LinkAuth=3";
memset(ri.cache_info.identity_digest, 'A', DIGEST_LEN); memset(ri.cache_info.identity_digest, 'A', DIGEST_LEN);
tt_assert(nodelist_set_routerinfo(&ri, NULL)); tt_assert(nodelist_set_routerinfo(&ri, NULL));