aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom van der Woerdt <info@tvdw.eu>2015-01-06 19:40:23 +0100
committerTom van der Woerdt <info@tvdw.eu>2015-01-06 19:40:23 +0100
commit4385211caf6ad4cf34c0a3aaaba42d81048fddf6 (patch)
treed53e7c29aaba170e36dfc61227b286417c132895
parentf5f80790d2abc1e418158827b1c8e398611d573a (diff)
downloadtor-4385211caf6ad4cf34c0a3aaaba42d81048fddf6.tar.gz
tor-4385211caf6ad4cf34c0a3aaaba42d81048fddf6.zip
Minor IPv6-related memory leak fixes
-rw-r--r--src/or/addressmap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/addressmap.c b/src/or/addressmap.c
index 33f11cb0ec..ece69ea6e6 100644
--- a/src/or/addressmap.c
+++ b/src/or/addressmap.c
@@ -104,6 +104,7 @@ addressmap_virtaddress_ent_free(void *_ent)
ent = _ent;
tor_free(ent->ipv4_address);
+ tor_free(ent->ipv6_address);
tor_free(ent->hostname_address);
tor_free(ent);
}
@@ -121,9 +122,11 @@ addressmap_virtaddress_remove(const char *address, addressmap_entry_t *ent)
if (ve) {
if (!strcmp(address, ve->ipv4_address))
tor_free(ve->ipv4_address);
+ if (!strcmp(address, ve->ipv6_address))
+ tor_free(ve->ipv6_address);
if (!strcmp(address, ve->hostname_address))
tor_free(ve->hostname_address);
- if (!ve->ipv4_address && !ve->hostname_address) {
+ if (!ve->ipv4_address && !ve->ipv6_address && !ve->hostname_address) {
tor_free(ve);
strmap_remove(virtaddress_reversemap, ent->new_address);
}