Fix buffer realloc size