Details
-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
None
-
Operating System: ReactOS
Platform: x86 Hardware
Description
Hello,
i have scanned the source of ReactOS with the static code analyis tool cppcheck. It found a resource leak in file ReactOS-0.3.10/base/applications/downloader/xml.c at line 206.
The tool prints the following output:
[ReactOS-0.3.10/base/applications/downloader/xml.c:206]: (error) Resource leak: file
Take a look at file xml.c:
BOOL ProcessXML (const char* filename, struct Category* Root)
{
...
FILE* file;
...
file = fopen("downloader.xml", "r");
if(!file)
{
file = fopen(filename, "r");
if(!file)
}
....
while (!done)
{
size_t len = fread (buffer, 1, sizeof(buffer), file);
done = len < sizeof(buffer);
if(!XML_Parse(parser, buffer, len, done))
{ MessageBoxW(0,Strings[IDS_XMLERROR_2],0,0); 206 return FALSE; }}
XML_ParserFree(parser);
fclose(file);
return TRUE;
}
As you can see, at line 206 there is missing fclose(file).
Best regards
Ettl Martin
Attachments
Issue Links
- duplicates
-
CORE-4305 mem/resource leak fixes for trunk
- Resolved