Memory leak has detected in malloc_stub.c:45:20
Hi, we have detected a memory leak in the rpl_malloc of malloc_stub.c
Besides, we have created a PoC of it and the reproduce step is : ./img2sixel -h 50% -r lanczos3 -w 300px $PoC
=================================================================
==17326==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 4500 byte(s) in 1 object(s) allocated from:
#0 0x498b9d in __interceptor_malloc (/root/option/libsixel/build_asan/bin/img2sixel+0x498b9d)
#1 0x4cdab7 in rpl_malloc /root/option/libsixel/converters/malloc_stub.c:45:20
#2 0x4dca67 in sixel_allocator_malloc /root/option/libsixel/src/allocator.c:162:12
#3 0x4f7136 in sixel_frame_resize /root/option/libsixel/src/frame.c:567:37
#4 0x4d8b7f in sixel_encoder_do_resize /root/option/libsixel/src/encoder.c:712:18
#5 0x4d7587 in sixel_encoder_encode_frame /root/option/libsixel/src/encoder.c:1039:18
#6 0x4d6f30 in load_image_callback /root/option/libsixel/src/encoder.c:1752:12
#7 0x54217e in load_gif /root/option/libsixel/src/fromgif.c:680:22
#8 0x501cc6 in load_with_builtin /root/option/libsixel/src/loader.c:948:18
#9 0x501155 in sixel_helper_load_image_file /root/option/libsixel/src/loader.c:1462:18
#10 0x4d6c47 in sixel_encoder_encode /root/option/libsixel/src/encoder.c:1816:14
#11 0x4cd728 in main /root/option/libsixel/converters/img2sixel.c:455:22
#12 0x732bcc2a9082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
SUMMARY: AddressSanitizer: 4500 byte(s) leaked in 1 allocation(s).
The PoC file is
id:000020,sig:08,src:001272+000019,argv:000000,time:2121469,execs:890921,op:splice,rep:2.zip
@optionGo Thanks for the report. I’ve applied the fix to the develop branch; it will be merged into master at the next release. Also, would you consent to us adding the PoC file you provided to the repository for regression testing?
Of course! Feel free to add the PoC file to the repository for regression testing. Thank you!