[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Fix a memory leak found while fuzzing



commit a092bcdd4f619e9b08ebb09049b4dd6cbdb3ee1c
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Mon Jan 9 14:25:48 2017 -0500

    Fix a memory leak found while fuzzing
---
 src/or/routerparse.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 0aa953c..8cdeb45 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -3711,11 +3711,10 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
     if (ns->type != NS_TYPE_CONSENSUS) {
       vote_routerstatus_t *rs = tor_malloc_zero(sizeof(vote_routerstatus_t));
       if (routerstatus_parse_entry_from_string(rs_area, &s, rs_tokens, ns,
-                                               rs, 0, 0))
+                                               rs, 0, 0)) {
         smartlist_add(ns->routerstatus_list, rs);
-      else {
-        tor_free(rs->version);
-        tor_free(rs);
+      } else {
+        vote_routerstatus_free(rs);
       }
     } else {
       routerstatus_t *rs;



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits