mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
fix possible descriptor leak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30100 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9c8cbba98d
commit
0d1923708f
2 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
2010-04-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* configure.ac: Fix for bug #29291 based on suggestion by Niels Grewe
|
||||
* Source/GSFileHandle.m: Fix possible descriptor leak.
|
||||
|
||||
2010-04-06 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
|
|
|
@ -1077,7 +1077,14 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
- (id) initWithFileDescriptor: (int)desc closeOnDealloc: (BOOL)flag
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
if (nil == self)
|
||||
{
|
||||
if (YES == flag)
|
||||
{
|
||||
close(desc);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
struct stat sbuf;
|
||||
int e;
|
||||
|
|
Loading…
Reference in a new issue