mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 23:21:38 +01:00
Write some free_all functions to free the auth. cookies.
We started allocating space for them on the heap in the previous commit. Conflicts: src/or/ext_orport.h
This commit is contained in:
parent
33c3e60a37
commit
f549e4c36d
5 changed files with 21 additions and 0 deletions
|
@ -4750,3 +4750,11 @@ control_event_clients_seen(const char *controller_str)
|
||||||
"650 CLIENTS_SEEN %s\r\n", controller_str);
|
"650 CLIENTS_SEEN %s\r\n", controller_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Free any leftover allocated memory of the control.c subsystem. */
|
||||||
|
void
|
||||||
|
control_free_all(void)
|
||||||
|
{
|
||||||
|
if (authentication_cookie) /* Free the auth cookie */
|
||||||
|
tor_free(authentication_cookie);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ MOCK_DECL(void, control_event_bootstrap_problem,(const char *warn,
|
||||||
int reason));
|
int reason));
|
||||||
|
|
||||||
void control_event_clients_seen(const char *controller_str);
|
void control_event_clients_seen(const char *controller_str);
|
||||||
|
void control_free_all(void);
|
||||||
|
|
||||||
#ifdef CONTROL_PRIVATE
|
#ifdef CONTROL_PRIVATE
|
||||||
/* Used only by control.c and test.c */
|
/* Used only by control.c and test.c */
|
||||||
|
|
|
@ -633,3 +633,11 @@ connection_ext_or_start_auth(or_connection_t *or_conn)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Free any leftover allocated memory of the ext_orport.c subsystem. */
|
||||||
|
void
|
||||||
|
ext_orport_free_all(void)
|
||||||
|
{
|
||||||
|
if (ext_or_auth_cookie) /* Free the auth cookie */
|
||||||
|
tor_free(ext_or_auth_cookie);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ int connection_ext_or_process_inbuf(or_connection_t *or_conn);
|
||||||
|
|
||||||
int init_ext_or_cookie_authentication(int is_enabled);
|
int init_ext_or_cookie_authentication(int is_enabled);
|
||||||
char *get_ext_or_auth_cookie_file_name(void);
|
char *get_ext_or_auth_cookie_file_name(void);
|
||||||
|
void ext_orport_free_all(void);
|
||||||
|
|
||||||
#ifdef EXT_ORPORT_PRIVATE
|
#ifdef EXT_ORPORT_PRIVATE
|
||||||
STATIC int connection_write_ext_or_command(connection_t *conn,
|
STATIC int connection_write_ext_or_command(connection_t *conn,
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
#include "routerparse.h"
|
#include "routerparse.h"
|
||||||
#include "statefile.h"
|
#include "statefile.h"
|
||||||
#include "status.h"
|
#include "status.h"
|
||||||
|
#include "ext_orport.h"
|
||||||
#ifdef USE_DMALLOC
|
#ifdef USE_DMALLOC
|
||||||
#include <dmalloc.h>
|
#include <dmalloc.h>
|
||||||
#include <openssl/crypto.h>
|
#include <openssl/crypto.h>
|
||||||
|
@ -2510,6 +2511,8 @@ tor_free_all(int postfork)
|
||||||
memarea_clear_freelist();
|
memarea_clear_freelist();
|
||||||
nodelist_free_all();
|
nodelist_free_all();
|
||||||
microdesc_free_all();
|
microdesc_free_all();
|
||||||
|
ext_orport_free_all();
|
||||||
|
control_free_all();
|
||||||
if (!postfork) {
|
if (!postfork) {
|
||||||
config_free_all();
|
config_free_all();
|
||||||
or_state_free_all();
|
or_state_free_all();
|
||||||
|
|
Loading…
Add table
Reference in a new issue