diff --git a/src/geo_iterator/grib_iterator_class_lambert_azimuthal_equal_area.cc b/src/geo_iterator/grib_iterator_class_lambert_azimuthal_equal_area.cc index a3f2f32f8..009665ea4 100644 --- a/src/geo_iterator/grib_iterator_class_lambert_azimuthal_equal_area.cc +++ b/src/geo_iterator/grib_iterator_class_lambert_azimuthal_equal_area.cc @@ -256,7 +256,7 @@ int LambertAzimuthalEqualArea::init_sphere(grib_handle* h, return GRIB_OUT_OF_MEMORY; } lons_ = (double*)grib_context_malloc(h->context, nv * sizeof(double)); - if (!lats_) { + if (!lons_) { grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } diff --git a/src/geo_iterator/grib_iterator_class_lambert_conformal.cc b/src/geo_iterator/grib_iterator_class_lambert_conformal.cc index 5204d7638..6b8a6fe93 100644 --- a/src/geo_iterator/grib_iterator_class_lambert_conformal.cc +++ b/src/geo_iterator/grib_iterator_class_lambert_conformal.cc @@ -166,7 +166,7 @@ int LambertConformal::init_sphere(const grib_handle* h, return GRIB_OUT_OF_MEMORY; } lons_ = (double*)grib_context_malloc(h->context, nv * sizeof(double)); - if (!lats_) { + if (!lons_) { grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } @@ -291,7 +291,7 @@ int LambertConformal::init_oblate(const grib_handle* h, return GRIB_OUT_OF_MEMORY; } lons_ = (double*)grib_context_malloc(h->context, nv * sizeof(double)); - if (!lats_) { + if (!lons_) { grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } diff --git a/src/geo_iterator/grib_iterator_class_mercator.cc b/src/geo_iterator/grib_iterator_class_mercator.cc index 4d86164b1..e4a5496be 100644 --- a/src/geo_iterator/grib_iterator_class_mercator.cc +++ b/src/geo_iterator/grib_iterator_class_mercator.cc @@ -123,7 +123,7 @@ int Mercator::init_mercator(grib_handle* h, return GRIB_OUT_OF_MEMORY; } lons_ = (double*)grib_context_malloc(h->context, nv * sizeof(double)); - if (!lats_) { + if (!lons_) { grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } diff --git a/src/geo_iterator/grib_iterator_class_polar_stereographic.cc b/src/geo_iterator/grib_iterator_class_polar_stereographic.cc index f912374e0..181becee8 100644 --- a/src/geo_iterator/grib_iterator_class_polar_stereographic.cc +++ b/src/geo_iterator/grib_iterator_class_polar_stereographic.cc @@ -186,7 +186,7 @@ int PolarStereographic::init(grib_handle* h, grib_arguments* args) return GRIB_OUT_OF_MEMORY; } lons_ = (double*)grib_context_malloc(h->context, nv_ * sizeof(double)); - if (!lats_) { + if (!lons_) { grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv_ * sizeof(double)); return GRIB_OUT_OF_MEMORY; } diff --git a/src/geo_iterator/grib_iterator_class_space_view.cc b/src/geo_iterator/grib_iterator_class_space_view.cc index ddf8700ed..15b57156b 100644 --- a/src/geo_iterator/grib_iterator_class_space_view.cc +++ b/src/geo_iterator/grib_iterator_class_space_view.cc @@ -227,7 +227,7 @@ int SpaceView::init(grib_handle* h, grib_arguments* args) return GRIB_OUT_OF_MEMORY; } lons_ = (double*)grib_context_malloc(h->context, array_size); - if (!lats_) { + if (!lons_) { grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, array_size); return GRIB_OUT_OF_MEMORY; }