Bug 14012 - Two "use after free" bugs in HtmlOutputDev.cc
Summary: Two "use after free" bugs in HtmlOutputDev.cc
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-10 14:02 UTC by Kjartan Maraas
Modified: 2008-08-26 10:00 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Kjartan Maraas 2008-01-10 14:02:57 UTC
The coverity checker found these two:

--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -820,8 +820,8 @@ void HtmlOutputDev::doFrame(int firstPage){
   fName->append(".html");
 
   if (!(fContentsFrame = fopen(fName->getCString(), "w"))){
-    delete fName;
     error(-1, "Couldn't open html file '%s'", fName->getCString());
+    delete fName;
     return;
   }
   
@@ -934,8 +934,8 @@ HtmlOutputDev::HtmlOutputDev(char *fileName, char *title,
       if (!xml) right->append(".html");
       if (xml) right->append(".xml");
       if (!(page=fopen(right->getCString(),"w"))){
-       delete right;
        error(-1, "Couldn't open html file '%s'", right->getCString());
+       delete right;
        return;
       }  
       delete right;
Comment 1 Albert Astals Cid 2008-01-10 14:52:09 UTC
Fixed, thanks.
Comment 2 Daniel Stone 2008-08-26 10:00:02 UTC
*** Bug 17032 has been marked as a duplicate of this bug. ***


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.