We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 791

Summary: missing call to fclose
Product: SDL Reporter: Pavol Rusnak <stick>
Component: fileAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 1.2.13   
Hardware: x86   
OS: Linux   

Description Pavol Rusnak 2009-09-11 06:41:58 UTC
We've received the following report from the reporter:

----

I just had a look at factory package SDL-1.2.13-108.11

For source code file SDL-1.2.13/src/file/SDL_rwops.c
around line 460, function SDL_RWFromFile
is the following code

        fp = fopen(file, mode);

but I fail to notice the matching call to fclose.
This looks like a resource leak to me. Suggest add call
to fclose.
Comment 1 Ryan C. Gordon 2009-09-12 12:23:46 UTC
Not a bug: the fclose() is in stdio_close() in that file. It gets called through a function pointer when the RWops is closed.

--ryan.