]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cull_list.cpp
Made it compile :p
[user/henk/code/inspircd.git] / src / cull_list.cpp
index a911cbc7844a5c420c0562a2c7b4b18f2a9df3c9..74400ef1badfc3881f71f597d6e12f7b04560fed 100644 (file)
@@ -84,20 +84,17 @@ bool CullList::IsValid(userrec* user)
 CullItem::CullItem(userrec* u, std::string &r)
 {
         this->user = u;
-        this->reason = strdup(r.c_str());
+        this->reason = r;
 }
 
 CullItem::CullItem(userrec* u, const char* r)
 {
        this->user = u;
-       this->reason = strdup(r);
+       this->reason = r;
 }
 
 CullItem::~CullItem()
 {
-       if (reason)
-               free(reason);
-       reason = NULL;
 }
 
 userrec* CullItem::GetUser()
@@ -105,7 +102,7 @@ userrec* CullItem::GetUser()
         return this->user;
 }
 
-const char* CullItem::GetReason()
+std::string& CullItem::GetReason()
 {
         return this->reason;
 }
@@ -152,7 +149,7 @@ int CullList::Apply()
                 */
                if (IsValid(u))
                {
-                       kill_link(u,a->GetReason());
+                       kill_link(u,a->GetReason().c_str());
                        list.erase(list.begin());
                        /* So that huge numbers of quits dont block,
                         * we yield back to our mainloop every 15