bugfixed: the buf->base donot be free if nread==-4077