mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
free a small static string on exit.
svn:r10902
This commit is contained in:
parent
e96d807db4
commit
5190916670
@ -1784,6 +1784,7 @@ tor_free_all(int postfork)
|
||||
tor_free(timeout_event);
|
||||
/* Stuff in util.c */
|
||||
escaped(NULL);
|
||||
esc_router_info(NULL);
|
||||
if (!postfork) {
|
||||
logs_free_all(); /* free log strings. do this last so logs keep working. */
|
||||
}
|
||||
|
@ -5391,15 +5391,19 @@ routerlist_check_bug_417(void)
|
||||
* THIS FUNCTION IS NOT REENTRANT. Don't call it from outside the main
|
||||
* thread. Also, each call invalidates the last-returned value, so don't
|
||||
* try log_warn(LD_GENERAL, "%s %s", esc_router_info(a), esc_router_info(b));
|
||||
*
|
||||
* If <b>router</b> is NULL, it just frees its internal memory and returns.
|
||||
*/
|
||||
const char *
|
||||
esc_router_info(routerinfo_t *router)
|
||||
{
|
||||
static char *info;
|
||||
static char *info=NULL;
|
||||
char *esc_contact, *esc_platform;
|
||||
size_t len;
|
||||
if (info)
|
||||
tor_free(info);
|
||||
if (!router)
|
||||
return NULL; /* we're exiting; just free the memory we use */
|
||||
|
||||
esc_contact = esc_for_log(router->contact_info);
|
||||
esc_platform = esc_for_log(router->platform);
|
||||
|
Loading…
Reference in New Issue
Block a user