cppcheck warning: identicalConditionAfterEarlyExit
@@ -536,11 +536,13 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val)
values = (double*)grib_context_malloc_clear(a->context, size * sizeof(double));
err = grib_get_double_array(grib_handle_of_accessor(a), "codedValues", values, &size);
- if (err)
+ if (err) {
+ grib_context_free(a->context, values);
return err;
+ }
*val = values[idx];
grib_context_free(a->context, values);
- return err;
+ return GRIB_SUCCESS;
}
#else
