aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-07-17 09:26:45 +0000
committerRoger Dingledine <arma@torproject.org>2007-07-17 09:26:45 +0000
commitfcbb817db5507e85bba2d2b743dc0bd66fbf6103 (patch)
treea29c0a87c921595cadcdc111a2d89785c47bae46 /src/or/config.c
parentccfda2e3a32e180598d9b6c7f4fe8c3983763b64 (diff)
downloadtor-fcbb817db5507e85bba2d2b743dc0bd66fbf6103.tar
tor-fcbb817db5507e85bba2d2b743dc0bd66fbf6103.tar.gz
free another string, and the buffer freelists, on exit.
svn:r10851
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c14
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,