Skip to content

Commit eb2720a

Browse files
committed
missing fclose when returning early
1 parent 45f7c83 commit eb2720a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/ml/src/data.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,13 @@ int CvMLData::read_csv(const char* filename)
170170

171171
// skip header lines
172172
for( int i = 0; i < header_lines_number; i++ )
173+
{
173174
if( fgets( buf, M, file ) == 0 )
175+
{
176+
fclose(file);
174177
return -1;
178+
}
179+
}
175180

176181
// read the first data line and determine the number of variables
177182
if( !fgets_chomp( buf, M, file ))

0 commit comments

Comments
 (0)