From a8878569083bfa4753e9e118adee0ed1da6a0325 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 18 Oct 2009 03:09:39 +0000 Subject: Fix null dereference caused by tracking dummy git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11902 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/base.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/base.cpp') 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& 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(); -- cgit v1.2.3