Validate return values from the functions that we call from inside buffer.c