Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/vgui2/vgui_controls/BuildGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,8 @@ void BuildGroup::LoadControlSettings(const char *controlResourceName, const char
m_pResourceName = new char[strlen(controlResourceName) + 1];
strcpy(m_pResourceName, controlResourceName);

if (pathID)
// set path id only if it is not the same to prevent use-after-free
if (pathID && pathID != m_pResourcePathID)
{
delete [] m_pResourcePathID;
m_pResourcePathID = new char[strlen(pathID) + 1];
Expand Down