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

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