diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-07-23 12:04:59 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-08-28 09:40:53 -0400 |
commit | 47654d32497acae23aafbe3316ae73d3c00429c8 (patch) | |
tree | 9d9bb68efe2587b033eef4de945c4d887b2cfd76 /src/test/fuzz | |
parent | 3d1f9f583a45143c1259b8926f8c57fa57fc1efb (diff) | |
download | tor-47654d32497acae23aafbe3316ae73d3c00429c8.tar.gz tor-47654d32497acae23aafbe3316ae73d3c00429c8.zip |
Refactor config free logic to use a single path.
The right way to free a config object is now to wrap config_free(),
always. Instead of creating an alternative free function, objects
should provide an alternative clear callback to free any fields that
the configuration manager doesn't manage.
This lets us simplify our code a little, and lets us extend the
confparse.c code to manage additional fields in config_free.
Diffstat (limited to 'src/test/fuzz')
-rw-r--r-- | src/test/fuzz/fuzzing_common.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/fuzz/fuzzing_common.c b/src/test/fuzz/fuzzing_common.c index 1285d94aee..862acb2b35 100644 --- a/src/test/fuzz/fuzzing_common.c +++ b/src/test/fuzz/fuzzing_common.c @@ -1,6 +1,7 @@ /* Copyright (c) 2016-2019, The Tor Project, Inc. */ /* See LICENSE for licensing information */ #define CRYPTO_ED25519_PRIVATE +#define CONFIG_PRIVATE #include "orconfig.h" #include "core/or/or.h" #include "app/main/subsysmgr.h" @@ -189,7 +190,7 @@ main(int argc, char **argv) if (fuzz_cleanup() < 0) abort(); - tor_free(mock_options); + or_options_free(mock_options); UNMOCK(get_options); return 0; } |