Franc1sco/FixHintColorMessages

Memory leak

Closed this issue · 1 comments

void TextMsgFix(DataPack hPack)
{
int iCount = hPack.ReadCell();
static int iPlayers[MAXPLAYERS+1];
for(int i = 0; i < iCount; i++)
{
iPlayers[i] = hPack.ReadCell();
}
int[] newClients = new int[MaxClients];
int newTotal = 0;
for (int i = 0; i < iCount; i++) {
int client = iPlayers[i];
if (IsClientInGame(client)) {
newClients[newTotal] = client;
newTotal++;
}
}
if (newTotal == 0) {
return;
}
static char sBuf[sizeof g_sSpace];
hPack.ReadString(sBuf, sizeof sBuf);
delete hPack;

If newTotal equals to 0, datapack leaves don't closed.

Fixed, thanks.