mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 07:03:44 +01:00
Don't call fmt_addr() twice in a parameter list.
This commit is contained in:
parent
a01736e8b2
commit
634d24c588
5
changes/bug7014
Normal file
5
changes/bug7014
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
o Minor bugfixes:
|
||||||
|
- Fix two cases in src/or/transports.c where we were calling
|
||||||
|
fmt_addr() twice in a parameter list. Bug found by David
|
||||||
|
Fifield. Fixes bug 7014; bugfix on 0.2.3.9-alpha.
|
||||||
|
|
@ -270,19 +270,22 @@ transport_resolve_conflicts(const transport_t *t)
|
|||||||
t_tmp->marked_for_removal = 0;
|
t_tmp->marked_for_removal = 0;
|
||||||
return 1;
|
return 1;
|
||||||
} else { /* same name but different addrport */
|
} else { /* same name but different addrport */
|
||||||
|
char *new_transport_addr = tor_strdup(fmt_addr(&t->addr));
|
||||||
if (t_tmp->marked_for_removal) { /* marked for removal */
|
if (t_tmp->marked_for_removal) { /* marked for removal */
|
||||||
log_notice(LD_GENERAL, "You tried to add transport '%s' at '%s:%u' "
|
log_notice(LD_GENERAL, "You tried to add transport '%s' at '%s:%u' "
|
||||||
"but there was already a transport marked for deletion at "
|
"but there was already a transport marked for deletion at "
|
||||||
"'%s:%u'. We deleted the old transport and registered the "
|
"'%s:%u'. We deleted the old transport and registered the "
|
||||||
"new one.", t->name, fmt_addr(&t->addr), t->port,
|
"new one.", t->name, new_transport_addr, t->port,
|
||||||
fmt_addr(&t_tmp->addr), t_tmp->port);
|
fmt_addr(&t_tmp->addr), t_tmp->port);
|
||||||
smartlist_remove(transport_list, t_tmp);
|
smartlist_remove(transport_list, t_tmp);
|
||||||
transport_free(t_tmp);
|
transport_free(t_tmp);
|
||||||
|
tor_free(new_transport_addr);
|
||||||
} else { /* *not* marked for removal */
|
} else { /* *not* marked for removal */
|
||||||
log_notice(LD_GENERAL, "You tried to add transport '%s' at '%s:%u' "
|
log_notice(LD_GENERAL, "You tried to add transport '%s' at '%s:%u' "
|
||||||
"but the same transport already exists at '%s:%u'. "
|
"but the same transport already exists at '%s:%u'. "
|
||||||
"Skipping.", t->name, fmt_addr(&t->addr), t->port,
|
"Skipping.", t->name, new_transport_addr, t->port,
|
||||||
fmt_addr(&t_tmp->addr), t_tmp->port);
|
fmt_addr(&t_tmp->addr), t_tmp->port);
|
||||||
|
tor_free(new_transport_addr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user