Blame SOURCES/freetype-2.9.1-png-memory-leak.patch

b4a942
From 007c109b4594c5e63948bd08b4d5011ad76ffb10 Mon Sep 17 00:00:00 2001
b4a942
From: Ben Wagner <bungeman@google.com>
b4a942
Date: Fri, 23 Oct 2020 08:29:14 +0200
b4a942
Subject: [PATCH] * src/sfnt/pngshim.c (Load_SBit_Png): Fix memory leak
b4a942
 (#59322).
b4a942
b4a942
The issue is that `rows` is allocated but will not be freed in the
b4a942
event that the call to `png_read_image` fails and calls `longjmp`.
b4a942
---
b4a942
 ChangeLog          | 7 +++++++
b4a942
 src/sfnt/pngshim.c | 1 +
b4a942
 2 files changed, 8 insertions(+)
b4a942
b4a942
diff --git a/src/sfnt/pngshim.c b/src/sfnt/pngshim.c
b4a942
index f55016122..d4e43a9f4 100644
b4a942
--- a/src/sfnt/pngshim.c
b4a942
+++ b/src/sfnt/pngshim.c
b4a942
@@ -443,6 +443,7 @@
b4a942
     png_read_end( png, info );
b4a942
 
b4a942
   DestroyExit:
b4a942
+    FT_FREE( rows );
b4a942
     png_destroy_read_struct( &png, &info, NULL );
b4a942
     FT_Stream_Close( &stream );
b4a942
 
b4a942
-- 
b4a942
2.26.2
b4a942