diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-03-28 02:03:51 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-03-28 02:03:51 +0000 |
commit | 1612df7b2c58ba775e3caaf3bf063f0598fd99f2 (patch) | |
tree | 8556084ec810f3955aab6692bab0868373b858e5 /src/or/connection_edge.c | |
parent | 0e26973c02314d3619050292fd40036f8a21f9e0 (diff) | |
download | tor-1612df7b2c58ba775e3caaf3bf063f0598fd99f2.tar.gz tor-1612df7b2c58ba775e3caaf3bf063f0598fd99f2.zip |
Fix a couple more places where we use ->new_address without checking that it is there.
svn:r3907
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 0a1db8eac5..1705637de9 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -760,7 +760,7 @@ addressmap_register_virtual_address(int type, char *new_address) &vent->ipv4_address : &vent->hostname_address; if (*addrp) { addressmap_entry_t *ent = strmap_get(addressmap, *addrp); - if (ent && !strcasecmp(new_address, ent->new_address)) { + if (ent && ent->new_address && !strcasecmp(new_address, ent->new_address)) { tor_free(new_address); return tor_strdup(*addrp); } else @@ -822,7 +822,7 @@ addressmap_get_mappings(smartlist_t *sl, time_t min_expires, time_t max_expires) addressmap_ent_remove(key, val); iter = strmap_iter_next_rmv(addressmap,iter); continue; - } else { + } else if (val->new_address) { size_t len = strlen(key)+strlen(val->new_address)+2; char *line = tor_malloc(len); tor_snprintf(line, len, "%s %s", key, val->new_address); |