dloebl / cgif

GIF encoder written in C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Small memory leak when calling cgif_close() without having called cgif_addframe()

inkmeister opened this issue · comments

There appears to be a small memory leak when cgif_close is called without first adding a frame by calling cgif_addframe. It appears cgif_close will skip some cleanups when pGIF->CurResult is != CGIF_OK. In this case, it’s CGIF_PENDING and so pGIF doesn’t get freed within cgif_raw_close. I appreciate this isn’t the most typical use case for cgif, but it is possible for it to happen in my application if it has to close down before having had chance to add a frame. Thanks for a great library.

Hi @inkmeister. Thanks for pointing out this issue.
I've added a test case/fix for this in #41.