buf_comparison, buf_size: add realloc() to allocation functions