sk_ENGINE_CLEANUP_ITEM_pop_free() is duplicated in ENGINE_cleanup().

Let's use sk_ENGINE_CLEANUP_ITEM_pop_free() instead.
This commit is contained in:
Richard Levitte 2001-10-01 17:15:28 +00:00
parent 0cff933416
commit 1cf9d58cb4

View File

@ -157,19 +157,17 @@ void engine_cleanup_add_last(ENGINE_CLEANUP_CB *cb)
sk_ENGINE_CLEANUP_ITEM_push(cleanup_stack, item); sk_ENGINE_CLEANUP_ITEM_push(cleanup_stack, item);
} }
/* The API function that performs all cleanup */ /* The API function that performs all cleanup */
static void engine_cleanup_cb_free(ENGINE_CLEANUP_ITEM *item)
{
(*(item->cb))();
OPENSSL_free(cb);
}
void ENGINE_cleanup(void) void ENGINE_cleanup(void)
{ {
if(int_cleanup_check(0)) if(int_cleanup_check(0))
{ {
int loop = 0, num = sk_ENGINE_CLEANUP_ITEM_num(cleanup_stack); sk_ENGINE_CLEANUP_ITEM_pop_free(cleanup_stack,
while(loop < num) engine_cleanup_cb_free);
{
ENGINE_CLEANUP_ITEM *item = sk_ENGINE_CLEANUP_ITEM_value(
cleanup_stack, loop++);
(*(item->cb))();
OPENSSL_free(item);
}
sk_ENGINE_CLEANUP_ITEM_free(cleanup_stack);
cleanup_stack = NULL; cleanup_stack = NULL;
} }
/* FIXME: This should be handled (somehow) through RAND, eg. by it /* FIXME: This should be handled (somehow) through RAND, eg. by it