Closed Bug 340361 Opened 14 years ago Closed 14 years ago

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

Categories

(Core :: Spelling checker, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: timeless, Assigned: sciguyryan)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity, memory-leak)

Attachments

(1 file, 1 obsolete file)

 
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.
Attached patch Patch v1 (obsolete) — Splinter Review
Use fclose on each if branch before returning.
Attachment #239379 - Flags: review?(mscott)
Assignee: mscott → sciguyryan+bugzilla
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+
Attached patch Patch v1.1Splinter Review
Removed the unneeded fclose per Scott's comment.
Attachment #239379 - Attachment is obsolete: true
Attachment #240294 - Flags: review?(mscott)
Attachment #240294 - Flags: review?(mscott) → review+
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
Closed: 14 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.