summaryrefslogtreecommitdiff
path: root/src/common/sandbox.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-12-01 10:36:02 -0500
committerNick Mathewson <nickm@torproject.org>2016-12-01 10:36:02 -0500
commit6a069959c6afac90231def95712b08b887735192 (patch)
treee0f878f459761667d797ad471ceca1b2dc83a3ef /src/common/sandbox.c
parentdb2571be619530389c7ca3066cfc86b32cfc7578 (diff)
downloadtor-6a069959c6afac90231def95712b08b887735192.tar.gz
tor-6a069959c6afac90231def95712b08b887735192.zip
Fix major errors in freeing getaddrinfo sandbox cache
Patch from cypherpunks. Fixes bug 20710; bugfix on 0.2.5.5-alpha.
Diffstat (limited to 'src/common/sandbox.c')
-rw-r--r--src/common/sandbox.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index e43b64b913..1059007771 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -1486,13 +1486,14 @@ sandbox_add_addrinfo(const char *name)
void
sandbox_free_getaddrinfo_cache(void)
{
- cached_getaddrinfo_item_t **next, **item;
+ cached_getaddrinfo_item_t **next, **item, *this;
for (item = HT_START(getaddrinfo_cache, &getaddrinfo_cache);
item;
item = next) {
+ this = *item;
next = HT_NEXT_RMV(getaddrinfo_cache, &getaddrinfo_cache, item);
- cached_getaddrinfo_item_free(*item);
+ cached_getaddrinfo_item_free(this);
}
HT_CLEAR(getaddrinfo_cache, &getaddrinfo_cache);