diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/db_plain.cpp | 2 | ||||
-rw-r--r-- | src/core/os_session.c | 2 | ||||
-rw-r--r-- | src/sessions.c | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/core/db_plain.cpp b/src/core/db_plain.cpp index 65eee0d3a..564cd9a35 100644 --- a/src/core/db_plain.cpp +++ b/src/core/db_plain.cpp @@ -481,7 +481,7 @@ static void LoadOperInfo(const std::vector<std::string> ¶ms) exceptions = static_cast<Exception *>(srealloc(exceptions, sizeof(Exception) * nexceptions)); exceptions[nexceptions - 1].mask = sstrdup(params[1].c_str()); exceptions[nexceptions - 1].limit = atol(params[2].c_str()); - exceptions[nexceptions - 1].who = params[3]; + exceptions[nexceptions - 1].who = sstrdup(params[3].c_str()); exceptions[nexceptions - 1].time = strtol(params[4].c_str(), NULL, 10); exceptions[nexceptions - 1].expires = strtol(params[5].c_str(), NULL, 10); exceptions[nexceptions - 1].reason = sstrdup(params[6].c_str()); diff --git a/src/core/os_session.c b/src/core/os_session.c index cff470e58..5bd5515e2 100644 --- a/src/core/os_session.c +++ b/src/core/os_session.c @@ -167,7 +167,7 @@ static int exception_view(User *u, const int index, int *sent_header) expire_left(u->nc, expirebuf, sizeof(expirebuf), exceptions[index].expires); - notice_lang(Config.s_OperServ, u, OPER_EXCEPTION_VIEW_FORMAT, index + 1, exceptions[index].mask, !exceptions[index].who.empty() ? exceptions[index].who.c_str() : "<unknown>", timebuf, expirebuf, exceptions[index].limit, exceptions[index].reason); + notice_lang(Config.s_OperServ, u, OPER_EXCEPTION_VIEW_FORMAT, index + 1, exceptions[index].mask, exceptions[index].who ? exceptions[index].who : "<unknown>", timebuf, expirebuf, exceptions[index].limit, exceptions[index].reason); return 1; } diff --git a/src/sessions.c b/src/sessions.c index c70cf821e..867373f27 100644 --- a/src/sessions.c +++ b/src/sessions.c @@ -266,6 +266,7 @@ void expire_exceptions() exceptions[i].mask); delete [] exceptions[i].mask; delete [] exceptions[i].reason; + delete [] exceptions[i].who; nexceptions--; memmove(exceptions + i, exceptions + i + 1, sizeof(Exception) * (nexceptions - i)); @@ -335,13 +336,13 @@ int exception_add(User * u, const char *mask, const int limit, } nexceptions++; - exceptions = static_cast<Exception *>(srealloc(exceptions, sizeof(Exception) * nexceptions)); + exceptions = new Exception[nexceptions]; exceptions[nexceptions - 1].mask = sstrdup(mask); exceptions[nexceptions - 1].limit = limit; exceptions[nexceptions - 1].reason = sstrdup(reason); exceptions[nexceptions - 1].time = time(NULL); - exceptions[nexceptions - 1].who = who; + exceptions[nexceptions - 1].who = sstrdup(who); exceptions[nexceptions - 1].expires = expires; exceptions[nexceptions - 1].num = nexceptions - 1; |