Browse Source

fix a memory leak introduced by df1ef2f0f0856af

Roger Dingledine 14 years ago
parent
commit
b1a5888553
2 changed files with 7 additions and 0 deletions
  1. 3 0
      changes/leak-weight-params
  2. 4 0
      src/or/networkstatus.c

+ 3 - 0
changes/leak-weight-params

@@ -0,0 +1,3 @@
+  o Minor bugfixes:
+    - Fix a memory leak every time we parse a v3 network consensus. Bugfix
+      on 0.2.2.10-alpha.

+ 4 - 0
src/or/networkstatus.c

@@ -351,6 +351,10 @@ networkstatus_vote_free(networkstatus_t *ns)
     SMARTLIST_FOREACH(ns->known_flags, char *, c, tor_free(c));
     smartlist_free(ns->known_flags);
   }
+  if (ns->weight_params) {
+    SMARTLIST_FOREACH(ns->weight_params, char *, c, tor_free(c));
+    smartlist_free(ns->weight_params);
+  }
   if (ns->net_params) {
     SMARTLIST_FOREACH(ns->net_params, char *, c, tor_free(c));
     smartlist_free(ns->net_params);