Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plug a memory leak when adding a font on some platforms
On macOS (with Core Text) and some versions of Windows (with DirectWrite) (specifically, Windows 10+ Win32 as well as all versions of WinRT/UWP), we read font metadata on our own via FreeType, filling implicit_meta in ass_font_provider_add_font. However, we forgot to free it upon successful font registration, leaking the memory allocated for the font name strings. The list of affected platforms would likely have expanded in the future, as we eventually intend to read font names on our own across the board. Leak introduced in commit 887e6cc. As a quick fix, add the corresponding frees on the successful path. Ideally, we should refactor this function to avoid copying any freshly allocated memory to begin with (and thus to avoid the need to free it). Fixes: libass#699
- Loading branch information