Fix a couple of issues pointed out by https://scan.coverity.com/

This commit is contained in:
Alexey Sokolov
2016-12-26 17:22:09 +00:00
parent b666931883
commit 2fcde9f2e1
6 changed files with 23 additions and 42 deletions
+7 -15
View File
@@ -549,28 +549,20 @@ class CAdminMod : public CModule {
const CString sNetwork = sLine.Token(3);
const CString sValue = sLine.Token(4, true);
CUser* pUser = nullptr;
CIRCNetwork* pNetwork = nullptr;
if (sValue.empty()) {
PutModule(
"Usage: SetNetwork <variable> <username> <network> <value>");
return;
}
if (sUsername.empty()) {
pUser = GetUser();
pNetwork = CModule::GetNetwork();
} else {
pUser = FindUser(sUsername);
if (!pUser) {
return;
}
CUser* pUser = FindUser(sUsername);
if (!pUser) {
return;
}
pNetwork = FindNetwork(pUser, sNetwork);
if (!pNetwork && !sNetwork.empty()) {
return;
}
CIRCNetwork* pNetwork = FindNetwork(pUser, sNetwork);
if (!pNetwork) {
return;
}
if (sVar.Equals("nick")) {