Confusion between algorithms resolved.
[openssl.git] / crypto / engine / engine_all.c
index 43da60483ba5422bc07c5c7a8eebe35d08b7f7a1..4d0244f351fc2c815e3da8f2be37ed6c057ebc12 100644 (file)
 
 static int engine_add(ENGINE *e)
        {
+       int toret = 1;
        if (!ENGINE_by_id(ENGINE_get_id(e)))
                {
                (void)ERR_get_error();
-               return ENGINE_add(e);
+               toret = ENGINE_add(e);
                }
-       return 1;
+       ENGINE_free(e);
+       return toret;
        }
 
 void ENGINE_load_cswift(void)