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().
This commit is contained in:
parent
ed775e9bb4
commit
63ee10379c
1 changed files with 2 additions and 2 deletions
|
@ -566,7 +566,6 @@ timeout_dead_authd_clients(void *notused __unused)
|
||||||
{
|
{
|
||||||
if(client_p->preClient->auth.timeout < rb_current_time())
|
if(client_p->preClient->auth.timeout < rb_current_time())
|
||||||
{
|
{
|
||||||
authd_free_client(client_p);
|
|
||||||
rb_dlinkAddAlloc(client_p, &freelist);
|
rb_dlinkAddAlloc(client_p, &freelist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -575,7 +574,8 @@ timeout_dead_authd_clients(void *notused __unused)
|
||||||
RB_DLINK_FOREACH_SAFE(ptr, nptr, freelist.head)
|
RB_DLINK_FOREACH_SAFE(ptr, nptr, freelist.head)
|
||||||
{
|
{
|
||||||
client_p = ptr->data;
|
client_p = ptr->data;
|
||||||
rb_dictionary_delete(cid_clients, RB_UINT_TO_POINTER(client_p->preClient->auth.cid));
|
authd_abort_client(client_p);
|
||||||
|
rb_dlinkDestroy(ptr, &freelist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue