freebsd-ports/deskutils/lightning-thunderbird/files/patch-gfx_src_ps_nsFontMetricsPS.cpp
Michael Johnson ea5fec4f4f Fix a double-free while performing print operations which could trigger a
segmentation fault if malloc debugging was enabled.

Submitted by:	marcus
Reported by:	dougb
2006-12-15 22:14:33 +00:00

26 lines
680 B
C++

--- gfx/src/ps/nsFontMetricsPS.cpp.orig Fri Dec 15 01:42:25 2006
+++ gfx/src/ps/nsFontMetricsPS.cpp Fri Dec 15 01:41:20 2006
@@ -1037,8 +1037,10 @@ nsFontPSXft::Init(nsXftEntry* aEntry,
nsFontPSXft::~nsFontPSXft()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;
@@ -2327,8 +2329,10 @@ nsXftType1Generator::Init(nsXftEntry* aE
nsXftType1Generator::~nsXftType1Generator()
{
- if (mEntry->mFace)
+ if (mEntry->mFace) {
FT_Done_Face(mEntry->mFace);
+ mEntry->mFace = nsnull;
+ }
if (FT_Done_FreeType(mFreeTypeLibrary))
return;