saitoha / libsixel

A SIXEL encoder/decoder implementation derived from kmiya's sixel (https://github.com/saitoha/sixel).
MIT License
2.45k stars 82 forks source link

Memory leak in sixel_encoder_encode_bytes #164

Open muetzenmann opened 2 years ago

muetzenmann commented 2 years ago

By using valgrind, I found a memory leak in sixel_encoder_encode_bytes.

frame is allocated via sixel_frame_new, but never free'd.

To fix it, you can change line 1798 to

sixel_frame_t *frame = NULL;

and add

sixel_frame_unref(frame);

before the return statement.