* src/pfr/pfrload.c (pfr_aux_name_load): Fix memory leak (#47567).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/ChangeLog b/ChangeLog
index 4794fde..520564a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-03-30 Werner Lemberg <wl@gnu.org>
+
+ * src/pfr/pfrload.c (pfr_aux_name_load): Fix memory leak (#47567).
+
2016-03-29 Werner Lemberg <wl@gnu.org>
* src/base/ftadvance.c (FT_Get_Advances): Fix invalid left shift.
diff --git a/src/pfr/pfrload.c b/src/pfr/pfrload.c
index 0bee83a..8592045 100644
--- a/src/pfr/pfrload.c
+++ b/src/pfr/pfrload.c
@@ -740,9 +740,8 @@
if ( len > 0 && p[len - 1] == 0 )
len--;
- /* check that each character is ASCII for making sure not to
- load garbage
- */
+ /* check that each character is ASCII */
+ /* for making sure not to load garbage */
ok = ( len > 0 );
for ( n = 0; n < len; n++ )
if ( p[n] < 32 || p[n] > 127 )
@@ -753,6 +752,9 @@
if ( ok )
{
+ if ( *astring )
+ FT_FREE( *astring );
+
if ( FT_ALLOC( result, len + 1 ) )
goto Exit;