Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==46210==ERROR: AddressSanitizer: heap-use-after-free on address 0x60400000e550 at pc 0x55c71dfee408 bp 0x7ffc0ba7e620 sp 0x7ffc0ba7e610 READ of size 4 at 0x60400000e550 thread T0 #0 0x55c71dfee407 in findBook_test (/out/package/ex6+0x5407) #1 0x55c71dfed47a in main (/out/package/ex6+0x447a) #2 0x7f5de8823b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #3 0x55c71dfec599 in _start (/out/package/ex6+0x3599) 0x60400000e550 is located 0 bytes inside of 40-byte region [0x60400000e550,0x60400000e578) freed by thread T0 here: #0 0x7f5de99f27a8 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xde7a8) #1 0x55c71dfec8e7 in removeBook (/out/package/ex6+0x38e7) #2 0x55c71dfed283 in main (/out/package/ex6+0x4283) #3 0x7f5de8823b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) previously allocated by thread T0 here: #0 0x7f5de99f2b40 in __interceptor_malloc (/usr/lib/x86_
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
Linked-List: 112976->44143->129093->77872->72715->82619->99133->88637->118336->151165->6345->76471->81493->137856->55747->128472->141719->126796->133090->30101->10763->86221->61911->87851->98526->42286->6415->52085->24661->66182->35103->126428->5122->92387->139078->119282->61615->40939->41865->28320->23489->134372->108020->151136->42598->109030->70266->74681->5516->123190->36560->35038->77033->4213->44768->46441->17625->53881->130629->11881->61059->56364->142350->154488->30772->56786->77417->146943->17450->21140->75300->27353->91774->39518->81565->62162->102075->38121->125478->4805->32347->103918->30592->141588->104535->29459->119391->147821->74265->24531->20219->139240->44211->152477->39336->56277->71643->145097->84366->76310->101482->123856->50476->51091->43444->50332->97270->119422->21559->129213->4407->113031->114780->135844->111713->68842->94860->127602->48673->93968->98149->141763->118523->80834->49239->85558->150333->2262->115510->25834->50391->39060->108821->79022->28772->123056->115015->22176->128081
JOJ Answer
Linked-List: 112976->44143->129093->77872->72715->82619->99133->88637->118336->151165->6345->76471->81493->137856->55747->128472->141719->126796->133090->30101->10763->86221->61911->87851->98526->42286->6415->52085->24661->66182->35103->126428->5122->92387->139078->119282->61615->40939->41865->28320->23489->134372->108020->151136->42598->109030->70266->74681->5516->123190->36560->35038->77033->4213->44768->46441->17625->53881->130629->11881->61059->56364->142350->154488->30772->56786->77417->146943->17450->21140->75300->27353->91774->39518->81565->62162->102075->38121->125478->4805->32347->103918->30592->141588->104535->29459->119391->147821->74265->24531->20219->139240->44211->152477->39336->56277->71643->145097->84366->76310->101482->123856->50476->51091->43444->50332->97270->119422->21559->129213->4407->113031->114780->135844->111713->68842->94860->127602->48673->93968->98149->141763->118523->80834->49239->85558->150333->2262->115510->25834->50391->39060->108821->79022->28772->123056->115015->22176->128081