diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-09-28 13:29:01 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-09-28 13:40:21 -0400 |
commit | a4b7525c3ce596d4221575806d44652aaa9047a9 (patch) | |
tree | a5d2a00ace1788a3167cd6adc86c94f5ef77930f /src/or/microdesc.c | |
parent | e98c9a1bf6e64a641fd904cbef58b1e46da89e91 (diff) | |
download | tor-a4b7525c3ce596d4221575806d44652aaa9047a9.tar.gz tor-a4b7525c3ce596d4221575806d44652aaa9047a9.zip |
Fix a crash bug in tor_assert(md->held_by_node)
The fix is to turn held_by_node into a reference count.
Fixes bug 4118; bugfix on 0.2.3.1-alpha.
Diffstat (limited to 'src/or/microdesc.c')
-rw-r--r-- | src/or/microdesc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/microdesc.c b/src/or/microdesc.c index 510b2f40f7..0517e47eac 100644 --- a/src/or/microdesc.c +++ b/src/or/microdesc.c @@ -522,7 +522,7 @@ microdesc_free(microdesc_t *md) } tor_fragile_assert(); } - if (md->held_by_node) { + if (md->held_by_nodes) { int found=0; const smartlist_t *nodes = nodelist_get_list(); SMARTLIST_FOREACH(nodes, node_t *, node, { @@ -533,15 +533,15 @@ microdesc_free(microdesc_t *md) }); if (found) { log_warn(LD_BUG, "microdesc_free() called, but md was still referenced " - "%d node(s)", found); + "%d node(s); held_by_nodes == %u", found, md->held_by_nodes); } else { - log_warn(LD_BUG, "microdesc_free() called with held_by_node set, but " + log_warn(LD_BUG, "microdesc_free() called with held_by_nodes set, but " "md was not refrenced by any nodes"); } tor_fragile_assert(); } //tor_assert(md->held_in_map == 0); - //tor_assert(md->held_by_node == 0); + //tor_assert(md->held_by_nodes == 0); if (md->onion_pkey) crypto_free_pk_env(md->onion_pkey); |