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

[tor-commits] [tor/master] test_channel_listener: free 'chan' explicitly



commit d5db40a0145457f6a1ee24ac1310511eaf62b959
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu May 16 15:34:28 2019 -0400

    test_channel_listener: free 'chan' explicitly
    
    This should fix CID 1437442, where coverity can't tell that
    channel_free_all() frees the fake channel we allocated.
---
 src/test/test_channel.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/test/test_channel.c b/src/test/test_channel.c
index 4c2bbc86b..6a6bc9d81 100644
--- a/src/test/test_channel.c
+++ b/src/test/test_channel.c
@@ -1540,6 +1540,10 @@ test_channel_listener(void *arg)
   channel_listener_dump_statistics(chan, LOG_INFO);
 
  done:
+  if (chan) {
+    channel_listener_unregister(chan);
+    tor_free(chan);
+  }
   channel_free_all();
 }
 
@@ -1566,4 +1570,3 @@ struct testcase_t channel_tests[] = {
     NULL, NULL },
   END_OF_TESTCASES
 };
-



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