diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2003-01-25 20:17:53 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2003-01-25 20:17:53 +0000 |
commit | 76b2090ea3960ac4768ea8e9722c3e00e4c8b185 (patch) | |
tree | d7d292fa3edadc74960aba777507894c1c6f8396 | |
parent | 81aab317a09f29682d080c2fa7477a12614a5fe6 (diff) |
Fixed WHOWAS memory leak
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@147 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/inspircd.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index b0d8d300b..194bd29c2 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -14,6 +14,9 @@ * --------------------------------------------------- $Log$ + Revision 1.3 2003/01/25 20:17:53 brain + Fixed WHOWAS memory leak + Revision 1.2 2003/01/25 20:00:45 brain Added /WHOWAS @@ -2803,18 +2806,23 @@ void AddWhoWas(userrec* u) // 3600 seconds in an hour ;) if ((i->second->signon)<(time(NULL)-(WHOWAS_STALE*3600))) { + delete i->second; i->second = a; debug("added WHOWAS entry, purged an old record"); return; } } } - debug("added fresh WHOWAS entry"); - whowas[a->nick] = a; + else + { + debug("added fresh WHOWAS entry"); + whowas[a->nick] = a; + } } else { debug("updated WHOWAS entry"); + delete iter->second; iter->second = a; } } |