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

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