summaryrefslogtreecommitdiff
path: root/src/test/fuzz/fuzz_vrs.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-01-09 14:29:15 -0500
committerNick Mathewson <nickm@torproject.org>2017-01-30 08:37:26 -0500
commit34fd6368708daec4c6af2b93d69d5ed774ac7c47 (patch)
treec7a675be9a2e86d603b94ccd4cd2492c9087d6f0 /src/test/fuzz/fuzz_vrs.c
parenta092bcdd4f619e9b08ebb09049b4dd6cbdb3ee1c (diff)
downloadtor-34fd6368708daec4c6af2b93d69d5ed774ac7c47.tar.gz
tor-34fd6368708daec4c6af2b93d69d5ed774ac7c47.zip
memory leak in fuzz_vrs
Diffstat (limited to 'src/test/fuzz/fuzz_vrs.c')
-rw-r--r--src/test/fuzz/fuzz_vrs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/fuzz/fuzz_vrs.c b/src/test/fuzz/fuzz_vrs.c
index 1c4e5e2bfa..406a4de5f3 100644
--- a/src/test/fuzz/fuzz_vrs.c
+++ b/src/test/fuzz/fuzz_vrs.c
@@ -45,7 +45,7 @@ fuzz_cleanup(void)
int
fuzz_main(const uint8_t *data, size_t sz)
{
- const char *str = tor_memdup_nulterm(data, sz), *s;
+ char *str = tor_memdup_nulterm(data, sz), *s;
routerstatus_t *rs_ns = NULL, *rs_md = NULL, *rs_vote = NULL;
vote_routerstatus_t *vrs = tor_malloc_zero(sizeof(*vrs));
smartlist_t *tokens = smartlist_new();
@@ -73,6 +73,7 @@ fuzz_main(const uint8_t *data, size_t sz)
vote_routerstatus_free(vrs);
memarea_clear(area);
smartlist_free(tokens);
+ tor_free(str);
return 0;
}