From 9370b063d0d8ecdd479370ee8c1d7946fbcad4be Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 10 May 2012 17:53:53 -0400 Subject: Fixed crash on access del + valgrind errors --- src/access.cpp | 3 +-- src/misc.cpp | 2 +- src/regchannel.cpp | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/access.cpp b/src/access.cpp index 189e275a3..40e53a305 100644 --- a/src/access.cpp +++ b/src/access.cpp @@ -118,8 +118,7 @@ Serializable* ChanAccess::unserialize(Serializable *obj, Serialize::Data &data) if (obj) access = anope_dynamic_static_cast(obj); else - access = const_cast(aprovider->Create()); - access->provider = aprovider; + access = aprovider->Create(); access->ci = ci; data["mask"] >> access->mask; data["creator"] >> access->creator; diff --git a/src/misc.cpp b/src/misc.cpp index fbc110ef3..e5ad71d45 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -669,7 +669,7 @@ bool Anope::Match(const Anope::string &str, const Anope::string &mask, bool case } } - if (mask[m] == '*') + if (m < mask_len && mask[m] == '*') ++m; return m == mask_len; diff --git a/src/regchannel.cpp b/src/regchannel.cpp index b113dfb2e..99554a6d5 100644 --- a/src/regchannel.cpp +++ b/src/regchannel.cpp @@ -638,7 +638,6 @@ void ChannelInfo::EraseAccess(const ChanAccess *taccess) { if (this->GetAccess(i) == taccess) { - this->GetAccess(i)->destroy(); this->EraseAccess(i); break; } -- cgit