[tor-commits] [tor/maint-0.3.2] Fix memory leak in test_channelpadding_consensus().

nickm at torproject.org nickm at torproject.org
Fri Jun 29 17:06:28 UTC 2018


commit 8550016e6f5e2780259f5073e34e67708e4e87ff
Author: Alexander Færøy <ahf at torproject.org>
Date:   Sat Jun 23 12:52:04 2018 +0200

    Fix memory leak in test_channelpadding_consensus().
    
    The relay variable is always allocated, but might not be freed before we
    return from this function.
    
    See: Coverity CID 1437431
---
 src/test/test_channelpadding.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/test/test_channelpadding.c b/src/test/test_channelpadding.c
index d54c9cc52..0bc9699fe 100644
--- a/src/test/test_channelpadding.c
+++ b/src/test/test_channelpadding.c
@@ -745,6 +745,8 @@ test_channelpadding_consensus(void *arg)
   tt_i64_op(val, OP_LE, 24*60*60*2);
 
  done:
+  tor_free(relay);
+
   free_mock_consensus();
   free_fake_channeltls((channel_tls_t*)chan);
   smartlist_free(connection_array);





More information about the tor-commits mailing list