diff options
author | Adam <Adam@anope.org> | 2012-05-10 17:53:53 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-05-10 17:53:53 -0400 |
commit | 9370b063d0d8ecdd479370ee8c1d7946fbcad4be (patch) | |
tree | 6203d66dc991e310b2c071ec4dc812c7566c8a11 | |
parent | d5ffae0e46a822ea358a8a87ea6910c5f2532bf7 (diff) |
Fixed crash on access del + valgrind errors
-rw-r--r-- | include/serialize.h | 8 | ||||
-rw-r--r-- | src/access.cpp | 3 | ||||
-rw-r--r-- | src/misc.cpp | 2 | ||||
-rw-r--r-- | src/regchannel.cpp | 1 |
4 files changed, 6 insertions, 8 deletions
diff --git a/include/serialize.h b/include/serialize.h index 441c4da8c..de937839d 100644 --- a/include/serialize.h +++ b/include/serialize.h @@ -216,7 +216,7 @@ class serialize_obj : public dynamic_reference_base this->ref->DelReference(this); } - virtual operator bool() const + inline operator bool() const { if (!this->invalid) return this->ref != NULL; @@ -235,7 +235,7 @@ class serialize_obj : public dynamic_reference_base this->ref->AddReference(this); } - virtual inline operator T*() const + inline operator T*() const { if (!this->invalid) { @@ -248,7 +248,7 @@ class serialize_obj : public dynamic_reference_base return NULL; } - virtual inline T* operator*() const + inline T* operator*() const { if (!this->invalid) { @@ -261,7 +261,7 @@ class serialize_obj : public dynamic_reference_base return NULL; } - virtual inline T* operator->() const + inline T* operator->() const { if (!this->invalid) { 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<ChanAccess *>(obj); else - access = const_cast<ChanAccess *>(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; } |