Commit 4742f4ec authored by Mark Andrews's avatar Mark Andrews
Browse files

unlink before unlock

parent e5961744
......@@ -401,6 +401,7 @@ free_session_list(pk11_sessionlist_t *slist) {
LOCK(&sessionlock);
while (!ISC_LIST_EMPTY(*slist)) {
sp = ISC_LIST_HEAD(*slist);
ISC_LIST_UNLINK(*slist, sp, link);
UNLOCK(&sessionlock);
if (sp->session != CK_INVALID_HANDLE) {
rv = pkcs_C_CloseSession(sp->session);
......@@ -408,7 +409,6 @@ free_session_list(pk11_sessionlist_t *slist) {
ret = DST_R_CRYPTOFAILURE;
}
LOCK(&sessionlock);
ISC_LIST_UNLINK(*slist, sp, link);
pk11_mem_put(sp, sizeof(*sp));
}
UNLOCK(&sessionlock);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment