freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master c8cd139 1/2: [cff] Free table upon error allocating o


From: Werner LEMBERG
Subject: [freetype2] master c8cd139 1/2: [cff] Free table upon error allocating other data (#58609).
Date: Thu, 18 Jun 2020 21:45:38 -0400 (EDT)

branch: master
commit c8cd139c3025f6371974c8aecfe3a393dd5ad994
Author: Sebastian Rasmussen <sebras@gmail.com>
Commit: Werner Lemberg <wl@gnu.org>

    [cff] Free table upon error allocating other data (#58609).
    
    * src/cff/cffload.c (cff_index_get_pointers): When new_bytes fails
    to allocate, make sure to free the table.  Do the same for both
    allocations if there is a later error.
---
 ChangeLog         | 8 ++++++++
 src/cff/cffload.c | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 9c4ab5f..ecfb8b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
+
+       [cff] Free table upon error allocating other data (#58609).
+
+       * src/cff/cffload.c (cff_index_get_pointers): When new_bytes fails
+       to allocate, make sure to free the table.  Do the same for both
+       allocations if there is a later error.
+
 2020-06-13  Werner Lemberg  <wl@gnu.org>
 
        Remove redundant inclusion of `ft2build.h'.
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 3a3df6b..13f4992 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -489,6 +489,10 @@
     }
 
   Exit:
+    if ( error && new_bytes )
+      FT_FREE( new_bytes );
+    if ( error && t )
+      FT_FREE( t );
     return error;
   }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]