Initialise ->global_cell prior to allocating memory for geometry.

This prevents freeing a random pointer in case of geometry allocation
failure.
This commit is contained in:
Bård Skaflestad 2012-03-02 14:04:44 +01:00
parent 560cb08313
commit 1a4367587f

View File

@ -206,6 +206,11 @@ preprocess (const struct grdecl *in, double tol)
g->cell_centroids = NULL;
g->cell_volumes = NULL;
/* Put ->global_cell in defined and harmless state to prevent
* freeing a random pointer in case of failing to allocate geometry
* resources. */
g->global_cell = NULL;
/* allocate and fill g->cell_faces/g->cell_facepos and
* g->cell_facetag */
fill_cell_topology(&pg, g);