mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 23:53:32 +01:00
Make sure callers can handle NULL ext-or auth cookie filename
This commit is contained in:
parent
17724a7cde
commit
eb07166eb8
@ -75,7 +75,8 @@ tor_cleanup(void)
|
|||||||
/* Remove Extended ORPort cookie authentication file */
|
/* Remove Extended ORPort cookie authentication file */
|
||||||
{
|
{
|
||||||
char *cookie_fname = get_ext_or_auth_cookie_file_name();
|
char *cookie_fname = get_ext_or_auth_cookie_file_name();
|
||||||
tor_remove_file(cookie_fname);
|
if (cookie_fname)
|
||||||
|
tor_remove_file(cookie_fname);
|
||||||
tor_free(cookie_fname);
|
tor_free(cookie_fname);
|
||||||
}
|
}
|
||||||
if (accounting_is_enabled(options))
|
if (accounting_is_enabled(options))
|
||||||
|
@ -1420,8 +1420,10 @@ create_managed_proxy_environment(const managed_proxy_t *mp)
|
|||||||
smartlist_add_asprintf(envs, "TOR_PT_EXTENDED_SERVER_PORT=%s",
|
smartlist_add_asprintf(envs, "TOR_PT_EXTENDED_SERVER_PORT=%s",
|
||||||
ext_or_addrport_tmp);
|
ext_or_addrport_tmp);
|
||||||
}
|
}
|
||||||
smartlist_add_asprintf(envs, "TOR_PT_AUTH_COOKIE_FILE=%s",
|
if (cookie_file_loc) {
|
||||||
cookie_file_loc);
|
smartlist_add_asprintf(envs, "TOR_PT_AUTH_COOKIE_FILE=%s",
|
||||||
|
cookie_file_loc);
|
||||||
|
}
|
||||||
|
|
||||||
tor_free(ext_or_addrport_tmp);
|
tor_free(ext_or_addrport_tmp);
|
||||||
tor_free(cookie_file_loc);
|
tor_free(cookie_file_loc);
|
||||||
|
Loading…
Reference in New Issue
Block a user