Fix some memleaks :^)

This commit is contained in:
BotoX 2016-12-05 21:14:59 +01:00
parent 4c6a9e7f57
commit 3818fea767
4 changed files with 17 additions and 1 deletions

View File

@ -356,6 +356,9 @@ public void APIWebResponse(const char[] sData, int client)
return; return;
} }
if(g_FriendsArray[client] != INVALID_HANDLE)
CloseHandle(g_FriendsArray[client]);
g_FriendsArray[client] = CreateArray(); g_FriendsArray[client] = CreateArray();
char sCommunityID[32]; char sCommunityID[32];

View File

@ -122,7 +122,10 @@ public Action Command_ForceInput(int client, int args)
int entity = TR_GetEntityIndex(hTrace); int entity = TR_GetEntityIndex(hTrace);
if(entity <= 1 || !IsValidEntity(entity)) if(entity <= 1 || !IsValidEntity(entity))
{
CloseHandle(hTrace);
return Plugin_Handled; return Plugin_Handled;
}
if(sArguments[2][0]) if(sArguments[2][0])
SetVariantString(sArguments[2]); SetVariantString(sArguments[2]);
@ -130,6 +133,7 @@ public Action Command_ForceInput(int client, int args)
AcceptEntityInput(entity, sArguments[1], client, client); AcceptEntityInput(entity, sArguments[1], client, client);
ReplyToCommand(client, "[SM] Input successful."); ReplyToCommand(client, "[SM] Input successful.");
} }
CloseHandle(hTrace);
} }
else else
{ {

View File

@ -108,14 +108,15 @@ public EConnect OnClientPreConnectEx(const char[] sName, char sPassword[255], co
public void AsyncHasSteamIDReservedSlotCallback(const char[] sSteam32ID, int Result, any Data) public void AsyncHasSteamIDReservedSlotCallback(const char[] sSteam32ID, int Result, any Data)
{ {
DataPack pack = view_as<DataPack>(Data);
// Slot free'd up while waiting or doesn't have a reserved slot? // Slot free'd up while waiting or doesn't have a reserved slot?
if(GetClientCount(false) < MaxClients || Result <= 0) if(GetClientCount(false) < MaxClients || Result <= 0)
{ {
delete pack;
ClientPreConnectEx(sSteam32ID, k_OnClientPreConnectEx_Accept, ""); ClientPreConnectEx(sSteam32ID, k_OnClientPreConnectEx_Accept, "");
return; return;
} }
DataPack pack = view_as<DataPack>(Data);
pack.Reset(); pack.Reset();
AdminId admin = view_as<AdminId>(pack.ReadCell()); AdminId admin = view_as<AdminId>(pack.ReadCell());

View File

@ -486,6 +486,14 @@ public Action Command_NominateList(int client, int args)
public int Handler_NominateListMenu(Handle menu, MenuAction action, int param1, int param2) public int Handler_NominateListMenu(Handle menu, MenuAction action, int param1, int param2)
{ {
switch(action)
{
case MenuAction_End:
{
delete menu;
}
}
return 0; return 0;
} }