N-Rage: Fix memory leak in GetN64ButtonArrayFromXAnalog and GetN64ButtonNameFromButtonCode

Replaced dynamic allocations (new[]) with static buffers to prevent memory leaks.
This commit is contained in:
pcca-matrix 2025-02-20 16:41:05 +01:00
parent f25e86792d
commit f295ecf523
1 changed files with 3 additions and 5 deletions

View File

@ -388,8 +388,7 @@ TCHAR * GetN64ButtonNameFromButtonCode( int Button )
{
using namespace N64_BUTTONS;
TCHAR *btnName;
btnName = new TCHAR[10];
static TCHAR btnName[10];
switch( Button )
{
@ -444,10 +443,9 @@ TCHAR * GetN64ButtonArrayFromXAnalog( LPXCONTROLLER gController, int XThStickOrX
using namespace N64_BUTTONS;
if( !gController || !gController->bConfigured )
return NULL;
return _T("");
TCHAR *name;
name = new TCHAR[15];
static TCHAR name[15];
switch( XThStickOrXDpad )
{