long_vector: Check error codes
@@ -185,12 +185,12 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len)
/*TODO implement the dirty mechanism to avoid to unpack every time */
err = grib_get_size(grib_handle_of_accessor(a), self->vector, &size);
- DebugAssert(!err);
+ if (err) return err;
DebugAssert(size > 0);
vector = (long*)grib_context_malloc(a->context, sizeof(long) * size);
err = grib_unpack_long(va, vector, &size);
- DebugAssert(!err);
grib_context_free(a->context, vector);
+ if (err) return err;
*val = v->v[self->index];
