checks buffer memory reallocation