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 ) {
|
if ( (fp = gzopen( filegz.c_str(), "rb" )) == NULL ) {
|
||||||
// cout << "ERROR: opening " << file << " or " << filegz
|
// cout << "ERROR: opening " << file << " or " << filegz
|
||||||
// << "for reading!" << endl;
|
// << "for reading!" << endl;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -197,6 +198,9 @@ bool SGBinObject::read_bin( const string& file ) {
|
|||||||
version = (header & 0x0000FFFF);
|
version = (header & 0x0000FFFF);
|
||||||
// cout << "File version = " << version << endl;
|
// cout << "File version = " << version << endl;
|
||||||
} else {
|
} else {
|
||||||
|
// close the file before we return
|
||||||
|
gzclose(fp);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user