shithub: freetype+ttf2subf

Download patch

ref: 9c1a2b043925a99c9e92ba11ef7824dcfe4ff942
parent: 7ce6c43c3e7cc78d1f698740012afb38a3985c0f
author: Werner Lemberg <[email protected]>
date: Tue Dec 22 07:05:46 EST 2015

* src/type1/t1load.c (parse_subrs): Fix memory leak (#46744).

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-12-22  Werner Lemberg  <[email protected]>
 
+	* src/type1/t1load.c (parse_subrs): Fix memory leak (#46744).
+
+2015-12-22  Werner Lemberg  <[email protected]>
+
 	[base] Make hash interface symmetric.
 
 	Use `num' and `str' infixes everywhere.
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1462,6 +1462,8 @@
         if ( FT_NEW( hash ) )
           goto Fail;
 
+        loader->subrs_hash = hash;
+
         error = ft_hash_num_init( hash, memory );
         if ( error )
           goto Fail;
@@ -1571,10 +1573,7 @@
     }
 
     if ( !loader->num_subrs )
-    {
-      loader->num_subrs  = num_subrs;
-      loader->subrs_hash = hash;
-    }
+      loader->num_subrs = num_subrs;
 
     return;