Close a binary file before we return (if it turns out not to be a binary file)
This commit is contained in:
parent
fad34bdbc3
commit
7ff9ba4fe6
@ -180,6 +180,7 @@ bool SGBinObject::read_bin( const string& file ) {
|
||||
if ( (fp = gzopen( filegz.c_str(), "rb" )) == NULL ) {
|
||||
// cout << "ERROR: opening " << file << " or " << filegz
|
||||
// << "for reading!" << endl;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -197,6 +198,9 @@ bool SGBinObject::read_bin( const string& file ) {
|
||||
version = (header & 0x0000FFFF);
|
||||
// cout << "File version = " << version << endl;
|
||||
} else {
|
||||
// close the file before we return
|
||||
gzclose(fp);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user