Bug 17674

Summary: Mismatched free() / delete in HtmlOutputDev.cc
Product: poppler Reporter: Tomas Are Haavet <tomasare>
Component: generalAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Tomas Are Haavet 2008-09-20 04:57:11 UTC
The text property in the HtmlString class is allocated with grealloc() and should therefore be freed with gfree() instead of delete in the HtmlString destructor.

diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index 54f62e7..df4b6bf 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -142,7 +142,7 @@ HtmlString::HtmlString(GfxState *state, double fontSize, HtmlFontAccu* fonts) {
 
 
 HtmlString::~HtmlString() {
-  delete text;
+  gfree(text);
   delete htext;
   gfree(xRight);
 }
Comment 1 Albert Astals Cid 2008-09-20 05:07:28 UTC
Thanks for the patch, will be fixed in poppler 0.9.2

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.