Calling rd_grid_alloc_mapaxes_kw will always return a rd_kw_type pointer with size 6, but grid->mapaxes may be null, meaning the data is instantiated to NULL so doing
for (int i = 0; i < rd_kw_get_size(mapaxes_kw);i++)
printf("%s\n", rd_kw_iget_float(mapaxes_kw, i));
will segfault.
There is a warning printed:
.../resdata/lib/resdata/rd_kw.cpp:726:11: runtime error: null pointer passed as argument 2, which is declared to never be
null
Calling rd_grid_alloc_mapaxes_kw will always return a rd_kw_type pointer with size 6, but grid->mapaxes may be null, meaning the data is instantiated to NULL so doing
will segfault.
There is a warning printed: