Fixed handle misuse in clientprefs plugin (bug 5805, r=psychonic).
Fixed handle misuse in clientprefs plugin (
bug 5805, r=psychonic).
1.1 --- a/plugins/clientprefs.sp Thu Jul 18 21:07:14 2013 -0400
1.2 +++ b/plugins/clientprefs.sp Sat Jul 20 15:17:43 2013 -0400
1.3 @@ -86,6 +86,7 @@
1.4 }
1.5 }
1.6
1.7 + CloseHandle(iter);
1.8 return Plugin_Handled;
1.9 }
1.10
1.11 @@ -112,6 +113,7 @@
1.12 if (access == CookieAccess_Private)
1.13 {
1.14 ReplyToCommand(client, "[SM] %t", "Cookie not Found", name);
1.15 + CloseHandle(cookie);
1.16 return Plugin_Handled;
1.17 }
1.18
1.19 @@ -123,12 +125,14 @@
1.20 GetClientCookie(client, cookie, value, sizeof(value));
1.21 ReplyToCommand(client, "[SM] %t", "Cookie Value", name, value);
1.22
1.23 + CloseHandle(cookie);
1.24 return Plugin_Handled;
1.25 }
1.26
1.27 if (access == CookieAccess_Protected)
1.28 {
1.29 ReplyToCommand(client, "[SM] %t", "Protected Cookie", name);
1.30 + CloseHandle(cookie);
1.31 return Plugin_Handled;
1.32 }
1.33
1.34 @@ -137,6 +141,7 @@
1.35 GetCmdArg(2, value, sizeof(value));
1.36
1.37 SetClientCookie(client, cookie, value);
1.38 + CloseHandle(cookie);
1.39 ReplyToCommand(client, "[SM] %t", "Cookie Changed Value", name, value);
1.40
1.41 return Plugin_Handled;