diff options
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/or/config.c b/src/or/config.c index 8654d54b5..bebc8caca 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -715,21 +715,22 @@ set_options(or_options_t *new_val, char **msg) extern const char tor_svn_revision[]; /* from tor_main.c */ +static char *_version = NULL; + /** Return the current Tor version, possibly */ const char * get_version(void) { - static char *version = NULL; - if (version == NULL) { + if (_version == NULL) { if (strlen(tor_svn_revision)) { size_t len = strlen(VERSION)+strlen(tor_svn_revision)+8; - version = tor_malloc(len); - tor_snprintf(version, len, "%s (r%s)", VERSION, tor_svn_revision); + _version = tor_malloc(len); + tor_snprintf(_version, len, "%s (r%s)", VERSION, tor_svn_revision); } else { - version = tor_strdup(VERSION); + _version = tor_strdup(VERSION); } } - return version; + return _version; } /** Release all memory and resources held by global configuration structures. @@ -746,6 +747,7 @@ config_free_all(void) global_state = NULL; } tor_free(torrc_fname); + tor_free(_version); } /** If options->SafeLogging is on, return a not very useful string, |