Commit fa37b635 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

crypt32: Moved ContextList freeing to store.c and get rid of ContextList.

parent bf464f81
......@@ -109,15 +109,3 @@ void Context_CopyProperties(const void *to, const void *from)
assert(toProperties && fromProperties);
ContextPropertyList_Copy(toProperties, fromProperties);
}
void ContextList_Free(ContextList *list)
{
context_t *context, *next;
LIST_FOR_EACH_ENTRY_SAFE(context, next, list, context_t, u.entry)
{
TRACE("removing %p\n", context);
list_remove(&context->u.entry);
Context_Release(context);
}
}
......@@ -433,13 +433,6 @@ void ContextPropertyList_Copy(CONTEXT_PROPERTY_LIST *to,
void ContextPropertyList_Free(CONTEXT_PROPERTY_LIST *list) DECLSPEC_HIDDEN;
/**
* Context list functions. A context list is a simple list of link contexts.
*/
typedef struct list ContextList;
void ContextList_Free(ContextList *list) DECLSPEC_HIDDEN;
extern WINECRYPT_CERTSTORE empty_store;
void init_empty_store(void) DECLSPEC_HIDDEN;
......
......@@ -215,6 +215,18 @@ static BOOL MemStore_deleteContext(WINE_MEMSTORE *store, context_t *context)
return TRUE;
}
static void free_contexts(struct list *list)
{
context_t *context, *next;
LIST_FOR_EACH_ENTRY_SAFE(context, next, list, context_t, u.entry)
{
TRACE("freeing %p\n", context);
list_remove(&context->u.entry);
Context_Release(context);
}
}
static BOOL MemStore_addCert(WINECRYPT_CERTSTORE *store, context_t *cert,
context_t *toReplace, context_t **ppStoreContext, BOOL use_link)
{
......@@ -317,9 +329,9 @@ static DWORD MemStore_release(WINECRYPT_CERTSTORE *cert_store, DWORD flags)
if(ref)
return (flags & CERT_CLOSE_STORE_CHECK_FLAG) ? CRYPT_E_PENDING_CLOSE : ERROR_SUCCESS;
ContextList_Free(&store->certs);
ContextList_Free(&store->crls);
ContextList_Free(&store->ctls);
free_contexts(&store->certs);
free_contexts(&store->crls);
free_contexts(&store->ctls);
store->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&store->cs);
CRYPT_FreeStore(&store->hdr);
......
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