[tor-commits] [tor/master] Fix a use-after-free error.

nickm at torproject.org nickm at torproject.org
Fri Nov 4 18:48:12 UTC 2016


commit 954fb99a48ea12a6c1aa48e2ce1a8acf8fbe456b
Author: David Goulet <dgoulet at torproject.org>
Date:   Fri Nov 4 14:03:35 2016 -0400

    Fix a use-after-free error.
---
 src/or/hs_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/or/hs_cache.c b/src/or/hs_cache.c
index b5369c0..b7ff979 100644
--- a/src/or/hs_cache.c
+++ b/src/or/hs_cache.c
@@ -131,8 +131,8 @@ cache_store_v3_as_dir(hs_cache_dir_descriptor_t *desc)
      * remove the entry we currently have from our cache so we can then
      * store the new one. */
     remove_v3_desc_as_dir(cache_entry);
-    cache_dir_desc_free(cache_entry);
     rend_cache_decrement_allocation(cache_get_entry_size(cache_entry));
+    cache_dir_desc_free(cache_entry);
   }
   /* Store the descriptor we just got. We are sure here that either we
    * don't have the entry or we have a newer descriptor and the old one





More information about the tor-commits mailing list