diff options
author | David Turner <david@freetype.org> | 2001-12-21 15:26:19 +0000 |
---|---|---|
committer | David Turner <david@freetype.org> | 2001-12-21 15:26:19 +0000 |
commit | 3a664fca14a5bea8fadfffedc00e4e66109cf085 (patch) | |
tree | b879647d8eb7787cbf2434a505a6bf36eb52a9bc /src/cid | |
parent | 79ea4cd40c88579369fea37751618e32e2ee5ab4 (diff) | |
download | freetype2-3a664fca14a5bea8fadfffedc00e4e66109cf085.tar.gz |
* src/cid/cidobjs.c (CID_Face_Done): fixed a memory leak, the subrs
routines were never released when CID faces were destroyed
Diffstat (limited to 'src/cid')
-rw-r--r-- | src/cid/cidload.c | 2 | ||||
-rw-r--r-- | src/cid/cidobjs.c | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/cid/cidload.c b/src/cid/cidload.c index ad3901391..561129198 100644 --- a/src/cid/cidload.c +++ b/src/cid/cidload.c @@ -446,7 +446,7 @@ if ( FILE_Seek( cid->data_offset + offsets[0] ) || FILE_Read( subr->code[0], data_len ) ) - goto Exit; + goto Fail; /* set up pointers */ for ( count = 1; count <= num_subrs; count++ ) diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c index e2eb67954..2d1e6b302 100644 --- a/src/cid/cidobjs.c +++ b/src/cid/cidobjs.c @@ -196,6 +196,25 @@ memory = face->root.memory; + /* release subrs */ + if ( face->subrs ) + { + FT_Int n; + + for ( n = 0; n < cid->num_dicts; n++ ) + { + CID_Subrs* subr = face->subrs + n; + + if ( subr->code ) + { + FREE( subr->code[0] ); + FREE( subr->code ); + } + } + + FREE( face->subrs ); + } + /* release FontInfo strings */ FREE( info->version ); FREE( info->notice ); |