From 549b2c1e62c6da4ceee128c09f39efea2aaf70d2 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 4 Dec 2005 22:07:52 +0000 Subject: Fixed segfault when file isnt found git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2178 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_helpop.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/modules/m_helpop.cpp') diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index ffd63cb06..6681d8f66 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -38,6 +38,9 @@ void handle_helpop(char **parameters, int pcnt, userrec *user) char a[MAXBUF]; std::string output = " "; + if (!helpop) + return; + if (pcnt < 1) { do_helpop(NULL,pcnt,user); @@ -176,6 +179,7 @@ class ModuleHelpop : public Module if (h_file == "") { + helpop = NULL; log(DEFAULT,"m_helpop: Helpop file not Specified."); return; } @@ -194,7 +198,8 @@ class ModuleHelpop : public Module virtual void OnRehash(std::string parameter) { delete conf; - delete helpop; + if (helpop) + delete helpop; ReadConfig(); } -- cgit v1.2.3