Skip to content

Commit 63ee103

Browse files
authored
timeout_dead_authd_clients(): fix memory leak and order of operations (#385)
Ensure we deallocate the nodes created by the first loop, and zero out the authd data after removing them from the authd clients dict. The authd_abort_client() function already does the latter, so just call that instead of authd_free_client().
1 parent ed775e9 commit 63ee103

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ircd/authproc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ timeout_dead_authd_clients(void *notused __unused)
566566
{
567567
if(client_p->preClient->auth.timeout < rb_current_time())
568568
{
569-
authd_free_client(client_p);
570569
rb_dlinkAddAlloc(client_p, &freelist);
571570
}
572571
}
@@ -575,7 +574,8 @@ timeout_dead_authd_clients(void *notused __unused)
575574
RB_DLINK_FOREACH_SAFE(ptr, nptr, freelist.head)
576575
{
577576
client_p = ptr->data;
578-
rb_dictionary_delete(cid_clients, RB_UINT_TO_POINTER(client_p->preClient->auth.cid));
577+
authd_abort_client(client_p);
578+
rb_dlinkDestroy(ptr, &freelist);
579579
}
580580
}
581581

0 commit comments

Comments
 (0)