diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-03-25 10:14:26 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-03-25 10:14:26 -0400 |
commit | 852fd1819e911dfafef624640d9b54157073c326 (patch) | |
tree | 76d73b9a15ccc24e57f557e4efaa48df04ab977c | |
parent | 1a7794e4750163a0ddc6e26a0a6fe12f799f9cb0 (diff) | |
download | tor-852fd1819e911dfafef624640d9b54157073c326.tar tor-852fd1819e911dfafef624640d9b54157073c326.tar.gz |
Free placeholder circid/chan->circuit map entries on exit
In circuitlist_free_all, we free all the circuits, removing them from
the map as we go, but we weren't actually freeing the placeholder
entries that we use to indicate pending DESTROY cells.
Fix for bug 11278; bugfix on the 7912 code that was merged in
0.2.5.1-alpha
-rw-r--r-- | changes/bug11278 | 3 | ||||
-rw-r--r-- | src/or/circuitlist.c | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/changes/bug11278 b/changes/bug11278 new file mode 100644 index 000000000..4fa59fc69 --- /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 b1efde5ad..5b8225a36 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); } |