Variable "afflst" leaked in half a dozen early returns from AffixMgr::parse_file(const char *)

RESOLVED FIXED in mozilla1.9alpha1

Status

()

Core
Spelling checker
RESOLVED FIXED
12 years ago
11 years ago

People

(Reporter: timeless, Assigned: sciguyryan)

Tracking

({coverity, mlk})

Trunk
mozilla1.9alpha1
coverity, mlk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 1 obsolete attachment)

2.02 KB, patch
Scott MacGregor
: review+
Details | Diff | Splinter Review
(Reporter)

Description

12 years ago
 

Comment 1

12 years ago
Maybe bugs against this code could/should also be filed in the openoffice.org Bugzilla, since the code in our tree is from their tree.
(Assignee)

Comment 2

11 years ago
Created attachment 239379 [details] [diff] [review]
Patch v1

Use fclose on each if branch before returning.
Attachment #239379 - Flags: review?(mscott)
(Assignee)

Updated

11 years ago
Assignee: mscott → sciguyryan+bugzilla

Comment 3

11 years ago
Comment on attachment 239379 [details] [diff] [review]
Patch v1

   afflst = fopen(affpath,"r");
   if (!afflst) {
     fprintf(stderr,"Error - could not open affix description file %s\n",affpath);
+    fclose(afflst);
     return 1;
   }

if afflst is null, calling fclose shouldn't be doing anything.

the rest of the patch looks good though. Please make sure that one line gets removed.
Attachment #239379 - Flags: review?(mscott) → review+
(Assignee)

Comment 4

11 years ago
Created attachment 240294 [details] [diff] [review]
Patch v1.1

Removed the unneeded fclose per Scott's comment.
Attachment #239379 - Attachment is obsolete: true
Attachment #240294 - Flags: review?(mscott)

Updated

11 years ago
Attachment #240294 - Flags: review?(mscott) → review+
(Assignee)

Updated

11 years ago
Whiteboard: [checkin needed]
I filed http://qa.openoffice.org/issues/show_bug.cgi?id=70408 to get this patch upstream.

mozilla/extensions/spellcheck/myspell/src/affixmgr.cpp 	1.5
Status: NEW → RESOLVED
Last Resolved: 11 years ago
OS: Windows XP → All
Hardware: PC → All
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Target Milestone: --- → mozilla1.9alpha
You need to log in before you can comment on or make changes to this bug.