Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
David Goulet
Tor
Commits
1b00492c
Commit
1b00492c
authored
Nov 11, 2007
by
Roger Dingledine
Browse files
a potential solution for bug 549
svn:r12471
parent
0d219959
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/or/dns.c
View file @
1b00492c
...
@@ -377,16 +377,15 @@ purge_expired_resolves(time_t now)
...
@@ -377,16 +377,15 @@ purge_expired_resolves(time_t now)
removed
?
removed
->
address
:
"NULL"
,
(
void
*
)
remove
);
removed
?
removed
->
address
:
"NULL"
,
(
void
*
)
remove
);
}
}
tor_assert
(
removed
==
resolve
);
tor_assert
(
removed
==
resolve
);
if
(
resolve
->
is_reverse
)
tor_free
(
resolve
->
result
.
hostname
);
resolve
->
magic
=
0xF0BBF0BB
;
tor_free
(
resolve
);
}
else
{
}
else
{
/* This should be in state DONE. Make sure it's not in the cache. */
/* This should be in state DONE. Make sure it's not in the cache. */
cached_resolve_t
*
tmp
=
HT_FIND
(
cache_map
,
&
cache_root
,
resolve
);
cached_resolve_t
*
tmp
=
HT_FIND
(
cache_map
,
&
cache_root
,
resolve
);
tor_assert
(
tmp
!=
resolve
);
tor_assert
(
tmp
!=
resolve
);
/* XXX020 shouldn't we be freeing 'resolve' here? */
}
}
if
(
resolve
->
is_reverse
)
tor_free
(
resolve
->
result
.
hostname
);
resolve
->
magic
=
0xF0BBF0BB
;
tor_free
(
resolve
);
}
}
assert_cache_ok
();
assert_cache_ok
();
...
@@ -708,9 +707,8 @@ dns_resolve_impl(edge_connection_t *exitconn, int is_resolve,
...
@@ -708,9 +707,8 @@ dns_resolve_impl(edge_connection_t *exitconn, int is_resolve,
tor_fragile_assert
();
tor_fragile_assert
();
}
}
tor_assert
(
0
);
tor_assert
(
0
);
}
else
if
(
resolve
)
{
log_warn
(
LD_BUG
,
"Found Mike's bug. Memory leak here!"
);
}
}
tor_assert
(
!
resolve
);
/* not there, need to add it */
/* not there, need to add it */
resolve
=
tor_malloc_zero
(
sizeof
(
cached_resolve_t
));
resolve
=
tor_malloc_zero
(
sizeof
(
cached_resolve_t
));
resolve
->
magic
=
CACHED_RESOLVE_MAGIC
;
resolve
->
magic
=
CACHED_RESOLVE_MAGIC
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment