From fb550bf4666586eedf840f7331c4796ad0739f1d Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 30 Mar 2016 18:55:27 +0200 Subject: [PATCH] * src/pfr/pfrload.c (pfr_aux_name_load): Thinko (#47567). --- ChangeLog | 4 ++++ src/pfr/pfrload.c | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b1cbd69c7..b1a1bd44b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2016-03-30 Werner Lemberg + + * src/pfr/pfrload.c (pfr_aux_name_load): Thinko (#47567). + 2016-03-30 Werner Lemberg * src/pfr/pfrload.c (pfr_log_font_count): Better font size estimate. diff --git a/src/pfr/pfrload.c b/src/pfr/pfrload.c index 989dd05ce..89ed204e2 100644 --- a/src/pfr/pfrload.c +++ b/src/pfr/pfrload.c @@ -743,6 +743,9 @@ FT_UInt n, ok; + if ( *astring ) + FT_FREE( *astring ); + if ( len > 0 && p[len - 1] == 0 ) len--; @@ -758,15 +761,13 @@ if ( ok ) { - if ( *astring ) - FT_FREE( *astring ); - if ( FT_ALLOC( result, len + 1 ) ) goto Exit; FT_MEM_COPY( result, p, len ); result[len] = 0; } + Exit: *astring = result; return error;