1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 07:16:39 +02:00

Fixed a crash on shutdown when running Anope on Mac

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2991 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Adam-
2010-05-30 03:01:33 +00:00
parent 15c66af4e5
commit 9b26a0dc09
3 changed files with 29 additions and 13 deletions
+13 -6
View File
@@ -15,8 +15,6 @@
#include "module.h"
Command *c;
void myOperServHelp(User * u);
int load_config(void);
int reload_config(int argc, char **argv);
@@ -29,6 +27,7 @@ int reload_config(int argc, char **argv);
**/
int AnopeInit(int argc, char **argv)
{
Command *c;
EvtHook *hook;
char buf[BUFSIZE];
@@ -62,7 +61,12 @@ int AnopeInit(int argc, char **argv)
**/
void AnopeFini(void)
{
free(c->help_param1);
Command *c = findCommand(OPERSERV, "LOGONNEWS");
if (c && c->help_param1)
{
free(c->help_param1);
c->help_param1 = NULL;
}
}
@@ -83,12 +87,15 @@ void myOperServHelp(User * u)
**/
int reload_config(int argc, char **argv) {
char buf[BUFSIZE];
Command *c;
if (argc >= 1) {
if (!stricmp(argv[0], EVENT_START)) {
free(c->help_param1);
snprintf(buf, BUFSIZE, "%d", NewsCount),
c->help_param1 = sstrdup(buf);
if ((c = findCommand(OPERSERV, "LOGONNEWS"))) {
free(c->help_param1);
snprintf(buf, BUFSIZE, "%d", NewsCount),
c->help_param1 = sstrdup(buf);
}
}
}
+14 -6
View File
@@ -15,8 +15,6 @@
#include "module.h"
Command *c;
void myOperServHelp(User * u);
int load_config(void);
int reload_config(int argc, char **argv);
@@ -29,6 +27,7 @@ int reload_config(int argc, char **argv);
**/
int AnopeInit(int argc, char **argv)
{
Command *c;
EvtHook *hook;
char buf[BUFSIZE];
@@ -62,7 +61,13 @@ int AnopeInit(int argc, char **argv)
**/
void AnopeFini(void)
{
free(c->help_param1);
Command *c = findCommand(OPERSERV, "OPERNEWS");
if (c && c->help_param1)
{
free(c->help_param1);
c->help_param1 = NULL;
}
}
@@ -82,12 +87,15 @@ void myOperServHelp(User * u)
**/
int reload_config(int argc, char **argv) {
char buf[BUFSIZE];
Command *c;
if (argc >= 1) {
if (!stricmp(argv[0], EVENT_START)) {
free(c->help_param1);
snprintf(buf, BUFSIZE, "%d", NewsCount),
c->help_param1 = sstrdup(buf);
if ((c = findCommand(OPERSERV, "OPERNEWS"))) {
free(c->help_param1);
snprintf(buf, BUFSIZE, "%d", NewsCount),
c->help_param1 = sstrdup(buf);
}
}
}
+2 -1
View File
@@ -9,9 +9,10 @@ VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="4"
VERSION_EXTRA="-svn"
VERSION_BUILD="2981"
VERSION_BUILD="2991"
# $Log$ # Changes since the 1.8.4 Release
#Revision 2991 - Fixed a crash on shutdown when running Anope on Mac
#Revision 2981 - Fixed SQUITing juped servers on InspIRCd 1.2
#Revision 2978 - Added param to EVENT_CHANGE_NICK for old nickname
#Revision 2976 - Added internal events called when nick is ghosted and when nick is recovered