Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==51247==ERROR: AddressSanitizer: heap-use-after-free on address 0x602000000030 at pc 0x000000515761 bp 0x7ffdc35e6230 sp 0x7ffdc35e6228 READ of size 1 at 0x602000000030 thread T0 #0 0x515760 (/out/package/ex7+0x515760) #1 0x5151bd (/out/package/ex7+0x5151bd) #2 0x7f3a25fd3b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #3 0x41ca29 (/out/package/ex7+0x41ca29) 0x602000000030 is located 0 bytes inside of 16-byte region [0x602000000030,0x602000000040) freed by thread T0 here: #0 0x4dc710 (/out/package/ex7+0x4dc710) #1 0x51514f (/out/package/ex7+0x51514f) #2 0x7f3a25fd3b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) previously allocated by thread T0 here: #0 0x4dcb08 (/out/package/ex7+0x4dcb08) #1 0x5158d4 (/out/package/ex7+0x5158d4) #2 0x5151a6 (/out/package/ex7+0x5151a6) #3 0x7f3a25fd3b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) SUMMARY: AddressSanitizer: heap-use-after-free (/out/package/ex7
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
JOJ Answer
***Print Linked List*** 1 ****Print Finished**** 0 0 1 ***Print Linked List*** j 1 ****Print Finished**** 2 ***Print Linked List*** j ****Print Finished**** 3 0 4 ***Print Linked List*** j a ****Print Finished**** 5 ***Print Linked List*** J j a ****Print Finished**** 6 0 7 ***Print Linked List*** y J j a ****Print Finished**** 8 ***Print Linked List*** 3 y J j a ****Print Finished**** 9 ***Print Linked List*** 4 3 y J j a ****Print Finished**** 10 6 11 ***Print Linked List*** 3 y J j a ****Print Finished**** 12 5 13 5 14 ***Print Linked List*** n 3 y J j a ****Print Finished**** 15 ***Print Linked List*** n 3 y J j a k ****Print Finished**** 16 ***Print Linked List*** n 3 y J j a k j ****Print Finished**** 17 ***Print Linked List*** K n 3 y J j a k j ****Print Finished**** 18 ***Print Linked List*** K n 3 y J j a k ****Print Finished**** 19 ***Print Linked List*** n 3 y J j a k ****Print Finished*