allocate a buffer earlier to suppress a compiler warning