summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changes/bug112783
-rw-r--r--src/or/circuitlist.c12
2 files changed, 15 insertions, 0 deletions
diff --git a/changes/bug11278 b/changes/bug11278
new file mode 100644
index 0000000000..4fa59fc690
--- /dev/null
+++ b/changes/bug11278
@@ -0,0 +1,3 @@
+ o Minor bugfixes:
+ - Free placeholder entries in our circuit table at exit; fixes
+ a harmless memory leak. Fixes bug 11278; bugfix on 0.2.5.1-alpha.
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 9313325508..b03b590aa5 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -833,6 +833,18 @@ circuit_free_all(void)
smartlist_free(circuits_pending_chans);
circuits_pending_chans = NULL;
+ {
+ chan_circid_circuit_map_t **elt, **next, *c;
+ for (elt = HT_START(chan_circid_map, &chan_circid_map);
+ elt;
+ elt = next) {
+ c = *elt;
+ next = HT_NEXT_RMV(chan_circid_map, &chan_circid_map, elt);
+
+ tor_assert(c->circuit == NULL);
+ tor_free(c);
+ }
+ }
HT_CLEAR(chan_circid_map, &chan_circid_map);
}