summaryrefslogtreecommitdiff
path: root/src/sessions.c
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-22 02:31:23 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-22 02:31:23 +0000
commitfb5d7d181578bcba25327dfd4c2d5727fa71ce33 (patch)
treefafebdfc364d887136587397d01d7431afc2a77a /src/sessions.c
parent16e667a2cecf9492954333fc7949b6636072f941 (diff)
Properly initialized new objects when needed so they don't contain garbage data.
Also, converted line endings in os_ignore_db from CR+LF to LF. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1784 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/sessions.c')
-rw-r--r--src/sessions.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sessions.c b/src/sessions.c
index 2a3344096..83c7d8474 100644
--- a/src/sessions.c
+++ b/src/sessions.c
@@ -254,11 +254,13 @@ int add_session(const char *nick, const char *host, char *hostip)
session = new Session;
session->host = sstrdup(host);
list = &sessionlist[HASH(session->host)];
+ session->prev = NULL;
session->next = *list;
if (*list)
(*list)->prev = session;
*list = session;
session->count = 1;
+ session->hits = 0;
return 1;
}
@@ -773,7 +775,7 @@ int do_exception(User * u)
if ((n1 >= 0 && n1 < nexceptions) && (n2 >= 0 && n2 < nexceptions)
&& (n1 != n2)) {
- exception = new Exception;
+ exception = (Exception *)smalloc(sizeof(Exception));
memcpy(exception, &exceptions[n1], sizeof(Exception));
if (n1 < n2) {
@@ -788,7 +790,7 @@ int do_exception(User * u)
memmove(&exceptions[n2], exception, sizeof(Exception));
}
- delete exception;
+ free(exception);
notice_lang(s_OperServ, u, OPER_EXCEPTION_MOVED,
exceptions[n1].mask, n1 + 1, n2 + 1);