Free engine on error.
authorBen Laurie <ben@links.org>
Sat, 16 Apr 2016 04:33:24 +0000 (05:33 +0100)
committerBen Laurie <ben@links.org>
Mon, 18 Apr 2016 09:21:56 +0000 (10:21 +0100)
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/engine/eng_cryptodev.c

index 59eab5a..bdc49ed 100644 (file)
@@ -1671,6 +1671,9 @@ void engine_load_cryptodev_int(void)
                                          cryptodev_rsa_nocrt_mod_exp);
             }
         }
+    } else {
+        ENGINE_free(engine);
+        return;
     }
 
 #ifndef OPENSSL_NO_DSA
@@ -1708,6 +1711,9 @@ void engine_load_cryptodev_int(void)
                                             cryptodev_dh_compute_key);
             }
         }
+    } else {
+        ENGINE_free(engine);
+        return;
     }
 #endif