windows: use static buffer instead of dynamic allocated buffer

This is not a memory leak but some tools may detect it as a memory
leak.