mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
Fix segfault in unit tests
svn:r4760
This commit is contained in:
parent
a6a12c02e3
commit
c031d14633
@ -1332,6 +1332,13 @@ options_dup(config_format_t *fmt, or_options_t *old)
|
||||
return newopts;
|
||||
}
|
||||
|
||||
/** Return a new empty or_options_t. Used for testing. */
|
||||
or_options_t *
|
||||
options_new(void)
|
||||
{
|
||||
return config_alloc(&options_format);
|
||||
}
|
||||
|
||||
/** Set <b>options</b> to hold reasonable defaults for most options.
|
||||
* Each option defaults to zero. */
|
||||
void
|
||||
|
@ -35,6 +35,7 @@ void get_platform_str(char *platform, size_t len);
|
||||
int is_obsolete_version(const char *myversion, const char *start);
|
||||
size_t read_escaped_data(const char *data, size_t len, int translate_newlines,
|
||||
char **out);
|
||||
or_options_t *options_new(void);
|
||||
|
||||
static char temp_dir[256];
|
||||
|
||||
@ -1522,7 +1523,7 @@ test_rend_fns(void)
|
||||
int
|
||||
main(int c, char**v)
|
||||
{
|
||||
or_options_t *options = tor_malloc_zero(sizeof(or_options_t));
|
||||
or_options_t *options = options_new();
|
||||
network_init();
|
||||
options_init(options);
|
||||
set_options(options);
|
||||
|
Loading…
Reference in New Issue
Block a user