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