See comment thread ta #9452 (comment)
The error field has a pointer, mainly used for printf'd extra data. That should be re-used when possible. That means adding a size field, and perhaps other cleanups.
This is important because the allocation is 1K. It should probably be 256 and longer printf strings should just be truncated (which vnsprintf does, happily).