CVSROOT: /cvsroot/freetype Module name: freetype2 Changes by: Werner LEMBERG <wl> 06/06/08 07:32:56
Modified files: . : ChangeLog src/bdf : bdflib.c Log message: * src/bdf/bdflib.c (bdf_load_font): Fix memory leaks in case of errors. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/freetype2/ChangeLog?cvsroot=freetype&r1=1.1348&r2=1.1349 http://cvs.savannah.gnu.org/viewcvs/freetype2/src/bdf/bdflib.c?cvsroot=freetype&r1=1.29&r2=1.30 Patches: Index: ChangeLog =================================================================== RCS file: /cvsroot/freetype/freetype2/ChangeLog,v retrieving revision 1.1348 retrieving revision 1.1349 diff -u -b -r1.1348 -r1.1349 --- ChangeLog 8 Jun 2006 06:00:08 -0000 1.1348 +++ ChangeLog 8 Jun 2006 07:32:56 -0000 1.1349 @@ -1,3 +1,8 @@ +2006-06-08 Werner Lemberg <[EMAIL PROTECTED]> + + * src/bdf/bdflib.c (bdf_load_font): Fix memory leaks in case of + errors. + 2006-06-07 David Turner <[EMAIL PROTECTED]> * src/type1/t1afm.c (KERN_INDEX): Make it more robust. Index: src/bdf/bdflib.c =================================================================== RCS file: /cvsroot/freetype/freetype2/src/bdf/bdflib.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -b -r1.29 -r1.30 --- src/bdf/bdflib.c 26 Mar 2006 07:19:07 -0000 1.29 +++ src/bdf/bdflib.c 8 Jun 2006 07:32:56 -0000 1.30 @@ -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; } _______________________________________________ Freetype-cvs mailing list Freetype-cvs@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-cvs