[tor-commits] [tor/master] Use dir_conn_clear_spool() in connection.c.

nickm at torproject.org nickm at torproject.org
Fri Jan 17 12:51:00 UTC 2020


commit 6e12a8f04714aa56308b06c691066cc3d4b0090b
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Jan 8 21:43:02 2020 -0500

    Use dir_conn_clear_spool() in connection.c.
    
    This is cleaner than iterating over the spool.
---
 src/core/mainloop/connection.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c
index 09b75c4e5..f0ebce9bb 100644
--- a/src/core/mainloop/connection.c
+++ b/src/core/mainloop/connection.c
@@ -719,11 +719,7 @@ connection_free_minimal(connection_t *conn)
     tor_free(dir_conn->requested_resource);
 
     tor_compress_free(dir_conn->compress_state);
-    if (dir_conn->spool) {
-      SMARTLIST_FOREACH(dir_conn->spool, spooled_resource_t *, spooled,
-                        spooled_resource_free(spooled));
-      smartlist_free(dir_conn->spool);
-    }
+    dir_conn_clear_spool(dir_conn);
 
     rend_data_free(dir_conn->rend_data);
     hs_ident_dir_conn_free(dir_conn->hs_ident);





More information about the tor-commits mailing list