* src/bdf/bdflib.c (bdf_load_font): Fix memory leaks in case of

errors.
This commit is contained in:
Werner Lemberg 2006-06-08 07:32:56 +00:00
parent 7d48cb06b4
commit b10e45a7fb
2 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2006-06-08 Werner Lemberg <wl@gnu.org>
* src/bdf/bdflib.c (bdf_load_font): Fix memory leaks in case of
errors.
2006-06-07 David Turner <david@freetype.org>
* src/type1/t1afm.c (KERN_INDEX): Make it more robust.

View File

@ -2224,7 +2224,7 @@
error = _bdf_readstream( stream, _bdf_parse_start,
(void *)p, &lineno );
if ( error )
goto Exit;
goto Fail;
if ( p->font != 0 )
{
@ -2316,7 +2316,7 @@
if ( FT_RENEW_ARRAY( p->font->comments,
p->font->comments_len,
p->font->comments_len + 1 ) )
goto Exit;
goto Fail;
p->font->comments[p->font->comments_len] = 0;
}
@ -2337,6 +2337,15 @@
}
return error;
Fail:
bdf_free_font( p->font );
memory = extmemory;
FT_FREE( p->font );
goto Exit;
}