diff options
author | Denis Kenzior <denkenz@gmail.com> | 2024-03-14 22:02:20 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2024-03-14 22:02:20 -0500 |
commit | 4509b47b453a95ea555ea570b9e6bebab92c4a65 (patch) | |
tree | 21712523e87d9fb3b32f87c6a72c16da43328200 | |
parent | 4a3fe812a58a8aa67e218840c842cdeddae9d23e (diff) |
unit: Fix memory leak
TEST: l_uintset_subtract
==2605188==
==2605188== HEAP SUMMARY:
==2605188== in use at exit: 96 bytes in 4 blocks
==2605188== total heap usage: 86 allocs, 82 frees, 2,896 bytes allocated
==2605188==
==2605188== 48 (24 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 3 of 4
==2605188== at 0x4841828: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2605188== by 0x10C49D: l_malloc (util.c:49)
==2605188== by 0x10BA2F: l_uintset_new_from_range (uintset.c:181)
==2605188== by 0x1094E6: test_uintset_subtract (test-uintset.c:389)
==2605188== by 0x10B078: l_test_run (test.c:69)
==2605188== by 0x109353: main (test-uintset.c:450)
==2605188==
==2605188== 48 (24 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 4
==2605188== at 0x4841828: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2605188== by 0x10C49D: l_malloc (util.c:49)
==2605188== by 0x10BA2F: l_uintset_new_from_range (uintset.c:181)
==2605188== by 0x1094F5: test_uintset_subtract (test-uintset.c:390)
==2605188== by 0x10B078: l_test_run (test.c:69)
==2605188== by 0x109353: main (test-uintset.c:450)
==2605188==
==2605188== LEAK SUMMARY:
==2605188== definitely lost: 48 bytes in 2 blocks
==2605188== indirectly lost: 48 bytes in 2 blocks
==2605188== possibly lost: 0 bytes in 0 blocks
==2605188== still reachable: 0 bytes in 0 blocks
==2605188== suppressed: 0 bytes in 0 blocks
==2605188==
==2605188== For lists of detected and suppressed errors, rerun with: -s
==2605188== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
-rw-r--r-- | unit/test-uintset.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/unit/test-uintset.c b/unit/test-uintset.c index 0d341149..091d2547 100644 --- a/unit/test-uintset.c +++ b/unit/test-uintset.c @@ -424,6 +424,9 @@ static void test_uintset_subtract(const void *data) assert(!l_uintset_contains(sub, 64)); assert(l_uintset_contains(sub, 63)); l_uintset_free(sub); + + l_uintset_free(set_b); + l_uintset_free(set_a); } int main(int argc, char *argv[]) |