From 9ab7c8aed395652a2e99b4972f2fc4acf34d8317 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 29 Jun 2022 14:10:04 +0930 Subject: [PATCH] connected/test: fix memleak in test. ``` VALGRIND=1 valgrind -q --error-exitcode=7 --track-origins=yes --leak-check=full --show-reachable=yes --errors-for-leak-kinds=all connectd/test/run-netaddress > /dev/null ==2483395== 16 bytes in 1 blocks are still reachable in loss record 1 of 15 ==2483395== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==2483395== by 0x10D59A: autodata_register_ (autodata.c:20) ==2483395== by 0x10EB26: register_autotype_type_to_string (type_to_string.h:77) ==2483395== by 0x10EB6B: register_one_type_to_string0 (type_to_string.c:8) ==2483395== by 0x188C0C: __libc_csu_init (in /home/rusty/devel/cvs/lightning/connectd/test/run-netaddress) ==2483395== by 0x4A3A00F: (below main) (libc-start.c:264) ==2483395== ==2483395== 40 bytes in 1 blocks are still reachable in loss record 2 of 15 ==2483395== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ... ``` Signed-off-by: Rusty Russell --- connectd/test/run-netaddress.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/connectd/test/run-netaddress.c b/connectd/test/run-netaddress.c index 586ec1644c09..f92ea8aa7582 100644 --- a/connectd/test/run-netaddress.c +++ b/connectd/test/run-netaddress.c @@ -231,4 +231,6 @@ int main(int argc, char *argv[]) assert(!IsValid(&wa)); assert(!IsIPv4(&wa)); assert(IsIPv6(&wa)); + + common_shutdown(); }