From eb46739ab57027e52674f640b4a4c6acf4480edf Mon Sep 17 00:00:00 2001 From: Peter Covington Date: Sat, 5 Aug 2023 18:38:04 -0400 Subject: [PATCH] Fixed vgui screens potentially crashing on save --- sp/src/game/server/vguiscreen.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sp/src/game/server/vguiscreen.cpp b/sp/src/game/server/vguiscreen.cpp index 8163131c..e26e08cc 100644 --- a/sp/src/game/server/vguiscreen.cpp +++ b/sp/src/game/server/vguiscreen.cpp @@ -82,7 +82,11 @@ bool CVGuiScreen::KeyValue( const char *szKeyName, const char *szValue ) const char* pszOutputName = szKeyName + 1; int i = m_PanelOutputs.Find(pszOutputName); if (!m_PanelOutputs.IsValidIndex(i)) - i = m_PanelOutputs.Insert(pszOutputName, new COutputEvent); + { + auto pMem = new COutputEvent; + V_memset(pMem, 0, sizeof(COutputEvent)); + i = m_PanelOutputs.Insert(pszOutputName, pMem); + } m_PanelOutputs[i]->ParseEventAction(szValue); return true;