[tor-commits] [tor/release-0.2.9] Actually free the worker_state_t object when we do an update with it

nickm at torproject.org nickm at torproject.org
Mon Oct 31 20:33:51 UTC 2016


commit 24b7b922ae9adc814890feae661ad64f474307f3
Author: Nick Mathewson <nickm at torproject.org>
Date:   Mon Oct 31 14:36:15 2016 -0400

    Actually free the worker_state_t object when we do an update with it
    
    Previously we freed the old "keys" object, but leaked the
    worker_state_t that we had taken it from.
    
    Fixes bug 20401; bugfix on 0.2.6.3-alpha.
---
 changes/bug20401   | 4 ++++
 src/or/cpuworker.c | 1 +
 2 files changed, 5 insertions(+)

diff --git a/changes/bug20401 b/changes/bug20401
new file mode 100644
index 0000000..85ab3c7
--- /dev/null
+++ b/changes/bug20401
@@ -0,0 +1,4 @@
+  o Minor bugfixes (relay):
+    - Avoid a small memory leak when informing worker threads about rotated
+      onion keys. Fixes bug 20401; bugfix on 0.2.6.3-alpha.
+
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index 26bc54b..fd6de6e 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -168,6 +168,7 @@ update_state_threadfn(void *state_, void *work_)
   server_onion_keys_free(state->onion_keys);
   state->onion_keys = update->onion_keys;
   update->onion_keys = NULL;
+  worker_state_free(update);
   ++state->generation;
   return WQ_RPL_REPLY;
 }





More information about the tor-commits mailing list