diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-18 03:09:39 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-18 03:09:39 +0000 |
commit | a8878569083bfa4753e9e118adee0ed1da6a0325 (patch) | |
tree | ff2f02e58a865d306957b7bda3ac99b36e4b2907 /src/base.cpp | |
parent | e50d016aa23083f81dcf181f68edb81c5b23c78d (diff) |
Fix null dereference caused by tracking dummy
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11902 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/base.cpp')
-rw-r--r-- | src/base.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/base.cpp b/src/base.cpp index 977227440..59196fec1 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -136,17 +136,22 @@ void Extensible::doUnhookExtensions(const std::vector<ExtensionItem*>& toRemove) } } +static struct DummyExtensionItem : LocalExtItem +{ + DummyExtensionItem() : LocalExtItem("", NULL) {} + void free(void*) {} +} dummy; + Extensible::Extensible() { - extensions[NULL] = NULL; + extensions[&dummy] = NULL; } CullResult Extensible::cull() { for(ExtensibleStore::iterator i = extensions.begin(); i != extensions.end(); ++i) { - if (i->first) - i->first->free(i->second); + i->first->free(i->second); } extensions.clear(); return classbase::cull(); |