Provide the possibility to clean up internal ENGINE structures. This
[openssl.git] / crypto / engine / engine_list.c
index cc57e658abed91b6d77eab8001838697143a8a24..2ca667e85dbb620ae382d6336526f54175eebf07 100644 (file)
@@ -376,6 +376,20 @@ int ENGINE_free(ENGINE *e)
        return 1;
        }
 
+void ENGINE_cleanup(void)
+        {
+        ENGINE *iterator = engine_list_head;
+
+        while(iterator != NULL)
+                {
+                ENGINE_remove(iterator);
+                ENGINE_free(iterator);
+                iterator = engine_list_head;
+                }
+        engine_list_flag = 0;
+        return;
+        }
+
 int ENGINE_set_id(ENGINE *e, const char *id)
        {
        if(id == NULL)