diff --git a/renderdoc/os/win32/win32_stringio.cpp b/renderdoc/os/win32/win32_stringio.cpp index 98633e171..348365137 100644 --- a/renderdoc/os/win32/win32_stringio.cpp +++ b/renderdoc/os/win32/win32_stringio.cpp @@ -303,10 +303,9 @@ namespace StringFormat int size = StringFormat::vsnprintf(NULL, 0, format, args2); char *buf = new char[size+1]; + StringFormat::vsnprintf(buf, size+1, format, args); buf[size] = 0; - StringFormat::vsnprintf(buf, size, format, args); - va_end(args); va_end(args2);