diff options
-rwxr-xr-x | src/svn-rev.sh | 2 | ||||
-rw-r--r-- | src/users.cpp | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/svn-rev.sh b/src/svn-rev.sh index f783b9ba6..8e804010c 100755 --- a/src/svn-rev.sh +++ b/src/svn-rev.sh @@ -1 +1 @@ -echo 3430 +echo 3432 diff --git a/src/users.cpp b/src/users.cpp index 5654133ec..11147298f 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -250,26 +250,30 @@ bool userrec::HasPermission(std::string &command) opertype_t::iterator iter_opertype = opertypes.find(this->oper); if (iter_opertype != opertypes.end()) { - char* Classes = iter_opertype->second; + char* Classes = strdup(iter_opertype->second); char* myclass = strtok_r(Classes," ",&savept); while (myclass) { operclass_t::iterator iter_operclass = operclass.find(myclass); if (iter_operclass != operclass.end()) { - char* CommandList = iter_operclass->second; + char* CommandList = strdup(iter_operclass->second); mycmd = strtok_r(CommandList," ",&savept2); while (mycmd) { if ((!strcasecmp(mycmd,command.c_str())) || (*mycmd == '*')) { + free(Classes); + free(CommandList); return true; } mycmd = strtok_r(NULL," ",&savept2); } + free(CommandList); } myclass = strtok_r(NULL," ",&savept); } + free(Classes); } } return false; |