Bug 525390

Summary: hatari-0.50-247.51: missing call to closedir
Product: [openSUSE] openSUSE 11.2 Reporter: David Binderman <dcb314>
Component: OtherAssignee: Wolfgang Engel <wolfgang.engel>
Status: RESOLVED UPSTREAM QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Factory   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 11.1   
URL: http://developer.berlios.de/bugs/?func=detailbug&bug_id=16364&group_id=10436
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2009-07-27 08:27:48 UTC
I just had a look at factory package hatari-0.50-247.51

For source code file hatari-0.50/src/screenSnapShot.c
around line 50 is the source code for the
function ScreenSnapShot_GetNum.

I notice the following line of code

  DIR *workingdir = opendir(szWorkingDir);

but no corresponding call to closedir.
This looks like a resource leak to me.

Suggest add call to closedir.
Comment 1 Richard Biener 2009-10-17 14:54:48 UTC
David, in case the issues are not introduced by a patch local to openSUSE please report the issues upstream.

Packagers, please do not add openSUSE-local patches to fix this kind of errors but forward the bugs upstream
and close the bugs as RESOLVED UPSTREAM.

Note that it is perfectly fine to have "resource leaks" at the end of a program as the kernel will clean
up for you.  Manually freeing them only increases binary size and runtime.