[tor-commits] [tor/master] memory leak in fuzz_vrs

nickm at torproject.org nickm at torproject.org
Mon Jan 30 13:45:48 UTC 2017


commit 34fd6368708daec4c6af2b93d69d5ed774ac7c47
Author: Nick Mathewson <nickm at torproject.org>
Date:   Mon Jan 9 14:29:15 2017 -0500

    memory leak in fuzz_vrs
---
 src/test/fuzz/fuzz_vrs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/test/fuzz/fuzz_vrs.c b/src/test/fuzz/fuzz_vrs.c
index 1c4e5e2..406a4de 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;
 }
 





More information about the tor-commits mailing list