Fix crash when unloading the arcfour module

Remove the empty Arcfour_Cleanup() function so that the default module cleanup can happen.

Define MODULE_NAME and use that when registering the module callbacks so that the default
module cleanup will remove them correctly.
This commit is contained in:
Kevin Easton
2018-02-20 23:00:00 +11:00
parent 3687e532f0
commit 5ae42802ec
2 changed files with 7 additions and 9 deletions

View File

@@ -31,6 +31,8 @@
#define INIT_MODULE
#include "modval.h"
#define MODULE_NAME "arcfour"
typedef struct {
int sock;
char ukey[16];
@@ -120,19 +122,13 @@ int Arcfour_Init(IrcCommandDll **intp, Function_ptr *global_table)
{
static const struct dcc_ops schat_ops = { NULL, start_dcc_crypt, dcc_schat_input, send_dcc_encrypt, end_dcc_crypt };
initialize_module("arcfour");
initialize_module(MODULE_NAME);
memset(keyboxes, 0, sizeof(keyboxes));
typenum = add_dcc_bind("SCHAT", "schat", &schat_ops);
add_module_proc(DCC_PROC, "schat", "schat", "Secure DCC Chat", 0, 0, dcc_sdcc, NULL);
typenum = add_dcc_bind("SCHAT", MODULE_NAME, &schat_ops);
add_module_proc(DCC_PROC, MODULE_NAME, "SCHAT", "Secure DCC Chat", 0, 0, dcc_sdcc, NULL);
return 0;
}
int Arcfour_Cleanup(IrcCommandDll **intp)
{
/* remove_dcc_bind("SCHAT", typenum); */
return 1;
}
static arclist *find_box(int sock)
{
int i, tmp;