fix bug in _buf_resize,because I miss understand realloc