Fixed memory leak.

This commit is contained in:
Oleg Tsvetkov 2016-06-12 01:30:11 +03:00
parent 71d5c297d3
commit 25eaa7ade3

View File

@ -334,6 +334,8 @@ public Action:ClassModifyCommand(client, argc)
if (attributeflag < 0) if (attributeflag < 0)
{ {
ReplyToCommand(client, "Invalid class attribute specified."); ReplyToCommand(client, "Invalid class attribute specified.");
CloseHandle(classlist);
return Plugin_Handled; return Plugin_Handled;
} }
@ -370,6 +372,8 @@ public Action:ClassModifyCommand(client, argc)
if (!listresult) if (!listresult)
{ {
ReplyToCommand(client, "Failed to get classes in the specified team: \"%s\".", classname); ReplyToCommand(client, "Failed to get classes in the specified team: \"%s\".", classname);
CloseHandle(classlist);
return Plugin_Handled; return Plugin_Handled;
} }
@ -432,6 +436,8 @@ public Action:ClassModifyCommand(client, argc)
if (!ClassValidateIndex(classindex)) if (!ClassValidateIndex(classindex))
{ {
ReplyToCommand(client, "Invalid class name specified."); ReplyToCommand(client, "Invalid class name specified.");
CloseHandle(classlist);
return Plugin_Handled; return Plugin_Handled;
} }
@ -478,6 +484,8 @@ public Action:ClassModifyCommand(client, argc)
} }
} }
CloseHandle(classlist);
return Plugin_Handled; return Plugin_Handled;
} }