Issue 103749 - cpputools/source/regcomplazy/regcomplazy.cxx: resource leak
Summary: cpputools/source/regcomplazy/regcomplazy.cxx: resource leak
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: DEV300m52
Hardware: All All
: P5 (lowest) Trivial (vote)
Target Milestone: OOo 3.2
Assignee: jsc
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks: 106602
  Show dependency tree
 
Reported: 2009-07-23 18:16 UTC by dcb314
Modified: 2010-03-01 07:28 UTC (History)
2 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
add fclose (530 bytes, patch)
2009-07-24 06:35 UTC, dtardon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description dcb314 2009-07-23 18:16:40 UTC
I just had my first look at the source code of Open Office.

For source code file cpputools/source/regcomplazy/regcomplazy.cxx,
around line 115 is the following source code

    FILE* fDescr = fopen(argv[ ++nPos ], "r");

I cannot find a matching call to fclose, so this looks like a memory leak.
Suggest code rework.
Comment 1 dtardon 2009-07-24 06:34:58 UTC
Well, the file gets closed on exit anyway (on every sane OS, at least), but from
the view of style it's better to have explicit fclose...
Comment 2 dtardon 2009-07-24 06:35:58 UTC
Created attachment 63709 [details]
add fclose
Comment 3 caolanm 2009-07-24 08:53:06 UTC
reassigning to better owner
Comment 4 kay.ramme 2009-07-28 12:09:55 UTC
Hi Juergen, please add the missing "fclose".
Comment 5 jsc 2009-07-28 12:18:19 UTC
accepted
Comment 6 kai.sommerfeld 2009-08-11 09:48:39 UTC
jsc: We should integrate this patch asap. Setting target to 3.2... 
Comment 7 jsc 2009-08-11 14:31:02 UTC
it's already on my list for the next 3.2 cws. It's not very important because
the file is closed on exit and the tool is used during the build process only.
But of course it's bad style and will be fixed.
Comment 8 jsc 2009-08-17 16:55:04 UTC
patch integrated on cws sb113
Comment 9 Stephan Bergmann 2009-09-01 09:14:52 UTC
.
Comment 10 jsc 2010-03-01 07:28:56 UTC
close