mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2143 Guard agains access of null pointer when reading NNC
This commit is contained in:
parent
4e20723650
commit
1c0d8c0dd0
@ -614,8 +614,11 @@ void RifReaderEclipseOutput::transferStaticNNCData(const ecl_grid_type* mainEclG
|
||||
|
||||
// Get the data from ERT
|
||||
ecl_nnc_geometry_type* nnc_geo = ecl_nnc_geometry_alloc(mainEclGrid);
|
||||
if (nnc_geo)
|
||||
{
|
||||
ecl_nnc_data_type* tran_data = ecl_nnc_data_alloc_tran(mainEclGrid, nnc_geo, ecl_file_get_global_view(init_file));
|
||||
|
||||
if (tran_data)
|
||||
{
|
||||
int numNNC = ecl_nnc_data_get_size(tran_data);
|
||||
int geometrySize = ecl_nnc_geometry_size(nnc_geo);
|
||||
CVF_ASSERT(numNNC == geometrySize);
|
||||
@ -640,10 +643,13 @@ void RifReaderEclipseOutput::transferStaticNNCData(const ecl_grid_type* mainEclG
|
||||
}
|
||||
}
|
||||
|
||||
ecl_nnc_geometry_free(nnc_geo);
|
||||
ecl_nnc_data_free(tran_data);
|
||||
}
|
||||
|
||||
ecl_nnc_geometry_free(nnc_geo);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user