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

[tor-commits] [tor/master] conn: Fix memleaks in retry_all_listeners



commit 4b646e30d8364e56fb6ae4ce5850f01e714eabcb
Author: David Goulet <dgoulet@xxxxxxxxxxxxxx>
Date:   Wed Sep 12 17:51:52 2018 -0400

    conn: Fix memleaks in retry_all_listeners
    
    Fixes #27670
    
    Signed-off-by: David Goulet <dgoulet@xxxxxxxxxxxxxx>
---
 src/core/mainloop/connection.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c
index 3c057ad14..7ef7423b1 100644
--- a/src/core/mainloop/connection.c
+++ b/src/core/mainloop/connection.c
@@ -2900,6 +2900,9 @@ retry_all_listeners(smartlist_t *new_conns, int close_all_noncontrol)
   } SMARTLIST_FOREACH_END(conn);
 
   smartlist_free(listeners);
+  /* Cleanup any remaining listener replacement. */
+  SMARTLIST_FOREACH(replacements, listener_replacement_t *, r, tor_free(r));
+  smartlist_free(replacements);
 
   if (old_or_port != router_get_advertised_or_port(options) ||
       old_or_port_ipv6 != router_get_advertised_or_port_by_af(options,

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