* src/sfnt/pngshim.c (Load_SBit_Png): Free `rows` once later.

This commit is contained in:
Alexei Podtelezhnikov 2021-03-16 22:12:41 -04:00
parent b0729b8fbb
commit e9c50fa77d
2 changed files with 5 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2021-03-16 Alexei Podtelezhnikov <apodtele@gmail.com>
* src/sfnt/pngshim.c (Load_SBit_Png): Free `rows` once later.
2021-03-16 Ben Wagner <bungeman@google.com>
[sfnt] Fix memory leak in png loading.

View File

@ -441,11 +441,10 @@
png_read_image( png, rows );
FT_FREE( rows );
png_read_end( png, info );
DestroyExit:
/* even if reading fails with longjmp, rows must be freed */
FT_FREE( rows );
png_destroy_read_struct( &png, &info, NULL );
FT_Stream_Close( &stream );