]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix memory leak in test_channelpadding_consensus().
authorAlexander Færøy <ahf@torproject.org>
Sat, 23 Jun 2018 10:52:04 +0000 (12:52 +0200)
committerAlexander Færøy <ahf@torproject.org>
Sat, 23 Jun 2018 10:52:04 +0000 (12:52 +0200)
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

index d54c9cc52c29bd3d0028ac5d21ebe4e85ea3e8ab..0bc9699feb45bee05cd1517012e376fb43d69058 100644 (file)
@@ -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);