diff options
author | David Goulet <dgoulet@torproject.org> | 2018-04-23 11:09:57 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2018-04-23 11:09:57 -0400 |
commit | b259008c56c44c32dfeea3ed8d4b06cd61751a88 (patch) | |
tree | fcc7fb4acb9b149c2d9b15bfd0a1411e38dbbc24 | |
parent | 1438c6c7134c53b2aa3b5e9abf94fe12a4d9bd5e (diff) | |
download | tor-b259008c56c44c32dfeea3ed8d4b06cd61751a88.tar.gz tor-b259008c56c44c32dfeea3ed8d4b06cd61751a88.zip |
hs: Fix memleak in v3 on SIGHUP
Fixes #25901
Signed-off-by: David Goulet <dgoulet@torproject.org>
-rw-r--r-- | changes/bug25901 | 3 | ||||
-rw-r--r-- | src/or/hs_service.c | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/changes/bug25901 b/changes/bug25901 new file mode 100644 index 0000000000..3ad30c7676 --- /dev/null +++ b/changes/bug25901 @@ -0,0 +1,3 @@ + o Minor bugfixes (hidden service v3): + - Fix a memory leak when an hidden service v3 is configured and gets a + SIGHUP signal. Fixes bug 25901; bugfix on 0.3.2.1-alpha. diff --git a/src/or/hs_service.c b/src/or/hs_service.c index 45810c5c5f..8ddd68c69e 100644 --- a/src/or/hs_service.c +++ b/src/or/hs_service.c @@ -840,6 +840,10 @@ move_hs_state(hs_service_t *src_service, hs_service_t *dst_service) /* Let's do a shallow copy */ dst->intro_circ_retry_started_time = src->intro_circ_retry_started_time; dst->num_intro_circ_launched = src->num_intro_circ_launched; + /* Freeing a NULL replaycache triggers an info LD_BUG. */ + if (dst->replay_cache_rend_cookie != NULL) { + replaycache_free(dst->replay_cache_rend_cookie); + } dst->replay_cache_rend_cookie = src->replay_cache_rend_cookie; src->replay_cache_rend_cookie = NULL; /* steal pointer reference */ |