Notes
This function is in beta test. Please help improve it in the issues
here.
$ ./l5_memory_check rand_char*.txt inc ================================================================= ==127077==ERROR: AddressSanitizer: heap-use-after-free on address 0x603000076310 at pc 0x000000515848 bp 0x7fff5cd8de00 sp 0x7fff5cd8ddf8 READ of size 8 at 0x603000076310 thread T0 #0 0x515847 (/out/package/l5_memory_check+0x515847) #1 0x51679d (/out/package/l5_memory_check+0x51679d) #2 0x5172ce (/out/package/l5_memory_check+0x5172ce) #3 0x517449 (/out/package/l5_memory_check+0x517449) #4 0x7fce366eab96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #5 0x41ca89 (/out/package/l5_memory_check+0x41ca89) 0x603000076310 is located 16 bytes inside of 24-byte region [0x603000076300,0x603000076318) freed by thread T0 here: #0 0x4dc770 (/out/package/l5_memory_check+0x4dc770) #1 0x515adb (/out/package/l5_memory_check+0x515adb) #2 0x516686 (/out/package/l5_memory_check+0x516686) #3 0x5172ce (/out/package/l5_memory_check+0x5172ce) #4 0x517449 (/out/package/l5_memory_c
Hints
Your answer may be identical to the JOJ answer in the first several lines.
However, the main problem you meet now is Runtime Error. And the exit code of your program is 1, which should be 0.
Please double check your code to solve this problem and try again.
Your Answer
Program exit with non zero value 1!
JOJ Answer
Correct!