mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-27 01:56:37 +02:00
Fixed pointer confusing in ModData system and made UnrealIRCd free all client ModData structures on client exit.
This commit is contained in:
+4
-4
@@ -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));
|
||||
|
||||
@@ -1331,5 +1331,5 @@ static int compare_floodprot_modes(ChanFloodProt *a, ChanFloodProt *b)
|
||||
|
||||
void userfld_free(ModData *md)
|
||||
{
|
||||
MyFree(md);
|
||||
MyFree(md->ptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user