diff options
author | Werner Lemberg <wl@gnu.org> | 2016-03-30 08:44:46 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2016-03-30 08:44:46 +0200 |
commit | ccd771cdf673eb55e7e0461e89568af7b70fb640 (patch) | |
tree | 907e063fffb82601756cc6eef7c52ca68b3e5245 | |
parent | ff82747e6d42faa3b11b6acec8976a2542e5eff8 (diff) | |
download | freetype2-ccd771cdf673eb55e7e0461e89568af7b70fb640.tar.gz |
* src/pfr/pfrload.c (pfr_aux_name_load): Fix memory leak (#47567).
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/pfr/pfrload.c | 8 |
2 files changed, 9 insertions, 3 deletions
@@ -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 0bee83a01..85920457b 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; |