]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
CAP TLS now implemented, this needs someone to make a client to test it :p
[user/henk/code/inspircd.git] / src / users.cpp
index 59fcf6c94dd8a523bec61acc597ec05702bc104c..46665396f0300297613ac61fc3e95b5f8fd009cf 100644 (file)
@@ -233,13 +233,13 @@ User::~User()
 
        if (this->AllowedUserModes)
        {
-               delete AllowedUserModes;
+               delete[] AllowedUserModes;
                AllowedUserModes = NULL;
        }
 
        if (this->AllowedChanModes)
        {
-               delete AllowedChanModes;
+               delete[] AllowedChanModes;
                AllowedChanModes = NULL;
        }
 
@@ -727,7 +727,7 @@ void User::Oper(const std::string &opertype, const std::string &opername)
                                        {
                                                if (*c == '*')
                                                {
-                                                       memset(this->AllowedUserModes, (int)(true), sizeof(this->AllowedUserModes));
+                                                       memset(this->AllowedUserModes, (int)(true), 64);
                                                }
                                                else
                                                {
@@ -738,7 +738,7 @@ void User::Oper(const std::string &opertype, const std::string &opername)
                                        {
                                                if (*c == '*')
                                                {
-                                                       memset(this->AllowedChanModes, (int)(true), sizeof(this->AllowedChanModes));
+                                                       memset(this->AllowedChanModes, (int)(true), 64);
                                                }
                                                else
                                                {
@@ -792,6 +792,17 @@ void User::UnOper()
                        delete AllowedOperCommands;
                        AllowedOperCommands = NULL;
                }
+               if (AllowedUserModes)
+               {
+                       delete[] AllowedUserModes;
+                       AllowedUserModes = NULL;
+               }
+               if (AllowedChanModes)
+               {
+                       delete[] AllowedChanModes;
+                       AllowedChanModes = NULL;
+               }
+
        }
 }