File tree Expand file tree Collapse file tree 4 files changed +22
-10
lines changed
Expand file tree Collapse file tree 4 files changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -61,9 +61,13 @@ endif()
6161add_test (tsan tsanFail)
6262
6363# Fails with LeakSanitizer
64- add_executable (lsanFail ../src/lsan_fail.c)
65- target_code_coverage(lsanFail AUTO ALL )
66- add_test (lsan lsanFail)
64+ add_executable (lsan_direct_leak ../src/lsan/direct_leak.c)
65+ target_code_coverage(lsan_direct_leak AUTO ALL )
66+ add_test (lsan_direct_leak lsan_direct_leak)
67+
68+ add_executable (lsan_indirect_leak ../src/lsan/indirect_leak.c)
69+ target_code_coverage(lsan_indirect_leak AUTO ALL )
70+ add_test (lsan_indirect_leak lsan_indirect_leak)
6771
6872# Fails with AddressSanitizer
6973if (EXAMPLE_USE_SANITIZER STREQUAL "address" )
Original file line number Diff line number Diff line change 1+ // example of a direct memory leak, where no pointer to the memory exists
2+ #include <stdlib.h>
3+
4+ int main () {
5+ void * p = malloc (7 );
6+ p = 0 ; // failure point
7+ return 0 ;
8+ }
Original file line number Diff line number Diff line change 1+ // example of an indirect memory leak, where a pointer to the memory still exists
2+ #include <stdlib.h>
3+
4+ int main () {
5+ void * p = malloc (7 );
6+ return 0 ;
7+ } // failure point
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments