If an engine comes up explicitely, it must also come down explicitely
[oweals/openssl.git] / apps / req.c
index d1411c91bbb89e6277e8a1899a3c9d6f265a93e8..4b57443ca354d46b59bfd6865f13cad0adac42b8 100644 (file)
@@ -1040,6 +1040,10 @@ int MAIN(int argc, char **argv)
     X509_REQ_free(req);
     X509_free(x509ss);
     ASN1_INTEGER_free(serial);
+#ifndef OPENSSL_NO_ENGINE
+    if (e != NULL)
+        release_engine(e);
+#endif
     if (passargin && passin)
         OPENSSL_free(passin);
     if (passargout && passout)