Fix memory leak.

Before:
51057 leaks for 850704 total leaked bytes.
After:
21258 leaks for 359284 total leaked bytes.
Both of these were taken right after the songs finish loading and the first screen is shown.
This commit is contained in:
Steve Checkoway
2004-07-21 06:13:57 +00:00
parent b7383e1010
commit 26d8a0b860
+2 -2
View File
@@ -173,14 +173,14 @@ void _SetString( char* psz, char* end, CString* ps, bool trim = false, int escap
{
len = _tcselen( escape, psz, end );
// char* pss = ps->GetBufferSetLength( len );
char* szTemp = new char[len];
char szTemp[len];
strlen( szTemp, escape, psz, end );
*ps = szTemp;
}
else
{
// char* pss = ps->GetBufferSetLength(len + 1 );
char* szTemp = new char[len+1];
char szTemp[len+1];
memcpy( szTemp, psz, len );
szTemp[len] = '\0';
*ps = szTemp;