mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-28 22:57:55 +03:00
Use AllocPooledString() to prevent memory leak in logic_substring
Co-authored-by: Spencer Brown <spencerb21@live.com>
This commit is contained in:
parent
99a8bdcb37
commit
3e9d3deda2
@ -80,7 +80,8 @@ void CLogicSubstring::InputInValue( inputdata_t &inputData )
|
||||
}
|
||||
char* strOutValue = (char*)malloc( lengthCheck );
|
||||
Q_strncpy( strOutValue, inputData.value.String() + startPosCheck, lengthCheck );
|
||||
m_OutValue.Set( MAKE_STRING(strOutValue), inputData.pActivator, this );
|
||||
m_OutValue.Set( AllocPooledString(strOutValue), inputData.pActivator, this );
|
||||
free(strOutValue);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user