diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-10-21 10:52:57 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-10-21 10:52:57 -0400 |
commit | aa96abe66b7ac507e927d4cfe37d78eaf754179e (patch) | |
tree | 3c951ed73463718ce6ab00bb48f53d3fb8ce3c1c | |
parent | 03eb999d42a582bece2063fc06f34fad72e05be5 (diff) | |
download | tor-aa96abe66b7ac507e927d4cfe37d78eaf754179e.tar.gz tor-aa96abe66b7ac507e927d4cfe37d78eaf754179e.zip |
Fix memory leak in rend_cache_failure_entry_free()
Bug 17402.
-rw-r--r-- | changes/bug17402 | 3 | ||||
-rw-r--r-- | src/or/rendcache.c | 14 |
2 files changed, 12 insertions, 5 deletions
diff --git a/changes/bug17402 b/changes/bug17402 new file mode 100644 index 0000000000..4760e00b04 --- /dev/null +++ b/changes/bug17402 @@ -0,0 +1,3 @@ + o Major bugfixes (memory leak): + - Fix a memory leak in rend_cache_failure_entry_free(). + Fixes bug 17402; bugfix on 0.2.7.3-rc. diff --git a/src/or/rendcache.c b/src/or/rendcache.c index 4a12b08c1c..93f4440193 100644 --- a/src/or/rendcache.c +++ b/src/or/rendcache.c @@ -122,6 +122,12 @@ rend_cache_failure_intro_entry_free(rend_cache_failure_intro_t *entry) tor_free(entry); } +static void +rend_cache_failure_intro_entry_free_(void *entry) +{ + rend_cache_failure_intro_entry_free_(entry); +} + /** Allocate a rend cache failure intro object and return it. <b>failure</b> * is set into the object. This function can not fail. */ static rend_cache_failure_intro_t * @@ -142,11 +148,9 @@ rend_cache_failure_entry_free(rend_cache_failure_t *entry) } /* Free and remove every intro failure object. */ - DIGESTMAP_FOREACH_MODIFY(entry->intro_failures, key, - rend_cache_failure_intro_t *, e) { - rend_cache_failure_intro_entry_free(e); - MAP_DEL_CURRENT(key); - } DIGESTMAP_FOREACH_END; + digestmap_free(entry->intro_failures, + rend_cache_failure_intro_entry_free_); + tor_free(entry); } |