From 6f4ea900c1ef6d685bcbbc2e8a2b1046bb61e10a Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Mon, 18 May 2015 16:42:01 +0200 Subject: [PATCH] Fixed pointer confusing in ModData system and made UnrealIRCd free all client ModData structures on client exit. --- src/moddata.c | 8 ++++---- src/modules/chanmodes/floodprot.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/moddata.c b/src/moddata.c index 4141c0e02..eacad0bf7 100644 --- a/src/moddata.c +++ b/src/moddata.c @@ -131,7 +131,7 @@ ModDataInfo *md; if (md->type == MODDATATYPE_CLIENT) { if (md->free && moddata_client(acptr, md).ptr) - md->free(moddata_client(acptr, md).ptr); + md->free(&moddata_client(acptr, md)); } memset(acptr->moddata, 0, sizeof(acptr->moddata)); @@ -145,7 +145,7 @@ ModDataInfo *md; if (md->type == MODDATATYPE_CHANNEL) { if (md->free && moddata_channel(chptr, md).ptr) - md->free(moddata_channel(chptr, md).ptr); + md->free(&moddata_channel(chptr, md)); } memset(chptr->moddata, 0, sizeof(chptr->moddata)); @@ -159,7 +159,7 @@ ModDataInfo *md; if (md->type == MODDATATYPE_MEMBER) { if (md->free && moddata_member(m, md).ptr) - md->free(moddata_member(m, md).ptr); + md->free(&moddata_member(m, md)); } memset(m->moddata, 0, sizeof(m->moddata)); @@ -173,7 +173,7 @@ ModDataInfo *md; if (md->type == MODDATATYPE_MEMBERSHIP) { if (md->free && moddata_membership(m, md).ptr) - md->free(moddata_membership(m, md).ptr); + md->free(&moddata_membership(m, md)); } memset(m->moddata, 0, sizeof(m->moddata)); diff --git a/src/modules/chanmodes/floodprot.c b/src/modules/chanmodes/floodprot.c index 95803a916..14288dd1d 100644 --- a/src/modules/chanmodes/floodprot.c +++ b/src/modules/chanmodes/floodprot.c @@ -1331,5 +1331,5 @@ static int compare_floodprot_modes(ChanFloodProt *a, ChanFloodProt *b) void userfld_free(ModData *md) { - MyFree(md); + MyFree(md->ptr); }