From c2d49ff75fa5479503a1374a44f2d6a14a11bf05 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Tue, 16 Oct 2018 04:40:28 +1100 Subject: [PATCH] add missing va_end "calls" --- Source/appfat.cpp | 2 ++ Source/logging.cpp | 1 + Source/msg.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/Source/appfat.cpp b/Source/appfat.cpp index 8c64ba059..2bf031a6c 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -214,6 +214,7 @@ void TermMsg(char *pszFmt, ...) FreeDlg(); if ( pszFmt ) MsgBox(pszFmt, arglist); + va_end(arglist); init_cleanup(0); exit(1); } @@ -254,6 +255,7 @@ void DrawDlg(char *pszFmt, ...) va_start(arglist, pszFmt); wvsprintf(text, pszFmt, arglist); + va_end(arglist); SDrawMessageBox(text, "Diablo", MB_TASKMODAL|MB_ICONEXCLAMATION); } diff --git a/Source/logging.cpp b/Source/logging.cpp index 885c51cb5..b8621f0e3 100644 --- a/Source/logging.cpp +++ b/Source/logging.cpp @@ -178,6 +178,7 @@ void log_printf(const char *pszFmt, ...) va_start(va, pszFmt); EnterCriticalSection(&sgMemCrit); _vsnprintf(v3, 0x200u, pszFmt, va); + va_end(va); v3[511] = 0; v1 = strlen(v3); if ( v1 + nNumberOfBytesToWrite > 0x1000 ) diff --git a/Source/msg.cpp b/Source/msg.cpp index 54c0bb15d..1235b3533 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -1878,6 +1878,7 @@ void msg_errorf(char *pszFmt, ...) vsprintf(v2, pszFmt, va); ErrorPlrMsg(v2); } + va_end(va); } // 67619C: using guessed type int msg_err_timer;