Bug 17674 - Mismatched free() / delete in HtmlOutputDev.cc
Summary: Mismatched free() / delete in HtmlOutputDev.cc
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-20 04:57 UTC by Tomas Are Haavet
Modified: 2008-09-20 05:07 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.