aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_channel.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-05-16 15:34:28 -0400
committerNick Mathewson <nickm@torproject.org>2019-05-16 15:35:21 -0400
commitd5db40a0145457f6a1ee24ac1310511eaf62b959 (patch)
tree2a7d122c92571632a9af10033ac80c2c28445e2f /src/test/test_channel.c
parent0a9685b3a7437e8851f8cb65fea3d0a16b7833a7 (diff)
downloadtor-d5db40a0145457f6a1ee24ac1310511eaf62b959.tar.gz
tor-d5db40a0145457f6a1ee24ac1310511eaf62b959.zip
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.
Diffstat (limited to 'src/test/test_channel.c')
-rw-r--r--src/test/test_channel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/test_channel.c b/src/test/test_channel.c
index 4c2bbc86b4..6a6bc9d810 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
};
-