mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 09:41:15 +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
250b37be9b
commit
25ff8b3385
2 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
2010-04-07 Richard Frith-Macdonald <rfm@gnu.org>
|
2010-04-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* configure.ac: Fix for bug #29291 based on suggestion by Niels Grewe
|
* 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>
|
2010-04-06 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
|
|
|
@ -1077,7 +1077,14 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
||||||
- (id) initWithFileDescriptor: (int)desc closeOnDealloc: (BOOL)flag
|
- (id) initWithFileDescriptor: (int)desc closeOnDealloc: (BOOL)flag
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self != nil)
|
if (nil == self)
|
||||||
|
{
|
||||||
|
if (YES == flag)
|
||||||
|
{
|
||||||
|
close(desc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
struct stat sbuf;
|
struct stat sbuf;
|
||||||
int e;
|
int e;
|
||||||
|
|
Loading…
Reference in a new issue