[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/main] Prop#324: Free congestion control object on circ and cpath



commit 66f975e4e6a7f991b4f49cb6c74e6b405f901969
Author: Mike Perry <mikeperry-git@xxxxxxxxxxxxxx>
Date:   Sat Jul 3 06:03:52 2021 +0000

    Prop#324: Free congestion control object on circ and cpath
---
 src/core/or/circuitlist.c | 3 +++
 src/core/or/crypt_path.c  | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/src/core/or/circuitlist.c b/src/core/or/circuitlist.c
index 46be358dec..35d810c660 100644
--- a/src/core/or/circuitlist.c
+++ b/src/core/or/circuitlist.c
@@ -100,6 +100,7 @@
 #include "lib/compress/compress_zlib.h"
 #include "lib/compress/compress_zstd.h"
 #include "lib/buf/buffers.h"
+#include "core/or/congestion_control_common.h"
 
 #include "core/or/ocirc_event.h"
 
@@ -1143,6 +1144,8 @@ circuit_free_(circuit_t *circ)
    * hs identifier is freed. */
   hs_circ_cleanup_on_free(circ);
 
+  congestion_control_free(circ->ccontrol);
+
   if (CIRCUIT_IS_ORIGIN(circ)) {
     origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);
     mem = ocirc;
diff --git a/src/core/or/crypt_path.c b/src/core/or/crypt_path.c
index 29356d7c2a..7673bc306f 100644
--- a/src/core/or/crypt_path.c
+++ b/src/core/or/crypt_path.c
@@ -27,6 +27,7 @@
 #include "core/or/circuitbuild.h"
 #include "core/or/circuitlist.h"
 #include "core/or/extendinfo.h"
+#include "core/or/congestion_control_common.h"
 
 #include "lib/crypt_ops/crypto_dh.h"
 #include "lib/crypt_ops/crypto_util.h"
@@ -165,6 +166,7 @@ cpath_free(crypt_path_t *victim)
   onion_handshake_state_release(&victim->handshake_state);
   crypto_dh_free(victim->rend_dh_handshake_state);
   extend_info_free(victim->extend_info);
+  congestion_control_free(victim->ccontrol);
 
   memwipe(victim, 0xBB, sizeof(crypt_path_t)); /* poison memory */
   tor_free(victim);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits