mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +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
|
@ -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…
Add table
Add a link
Reference in a new issue