Fixed leak when open returns 0
This commit is contained in:
@@ -20,9 +20,9 @@ ESRIShapeParser::ESRIShapeParser( const std::string fileName, bool useDouble ):
|
||||
if( !fileName.empty() )
|
||||
{
|
||||
#ifdef WIN32
|
||||
if( (fd = open( fileName.c_str(), O_RDONLY | O_BINARY )) <= 0 )
|
||||
if( (fd = open( fileName.c_str(), O_RDONLY | O_BINARY )) < 0 )
|
||||
#else
|
||||
if( (fd = open( fileName.c_str(), O_RDONLY )) <= 0 )
|
||||
if( (fd = open( fileName.c_str(), O_RDONLY )) < 0 )
|
||||
#endif
|
||||
{
|
||||
perror( fileName.c_str() );
|
||||
|
||||
Reference in New Issue
Block a user