From 25eaa7ade33e1ff0723d9988fb52b4492d9c7461 Mon Sep 17 00:00:00 2001 From: Oleg Tsvetkov Date: Sun, 12 Jun 2016 01:30:11 +0300 Subject: [PATCH] Fixed memory leak. --- src/zr/playerclasses/classcommands.inc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/zr/playerclasses/classcommands.inc b/src/zr/playerclasses/classcommands.inc index 3028162..3a27fed 100644 --- a/src/zr/playerclasses/classcommands.inc +++ b/src/zr/playerclasses/classcommands.inc @@ -334,6 +334,8 @@ public Action:ClassModifyCommand(client, argc) if (attributeflag < 0) { ReplyToCommand(client, "Invalid class attribute specified."); + CloseHandle(classlist); + return Plugin_Handled; } @@ -370,6 +372,8 @@ public Action:ClassModifyCommand(client, argc) if (!listresult) { ReplyToCommand(client, "Failed to get classes in the specified team: \"%s\".", classname); + CloseHandle(classlist); + return Plugin_Handled; } @@ -432,6 +436,8 @@ public Action:ClassModifyCommand(client, argc) if (!ClassValidateIndex(classindex)) { ReplyToCommand(client, "Invalid class name specified."); + CloseHandle(classlist); + return Plugin_Handled; } @@ -478,6 +484,8 @@ public Action:ClassModifyCommand(client, argc) } } + CloseHandle(classlist); + return Plugin_Handled; }