Fix some more memory leaks with TXT_DB_insert.
[oweals/openssl.git] / apps / x509.c
index 17cb62da726d076dbede51d257b51cb8cc70165f..ad9fc98edfb9c2a9c77ea8920c93a9b7451ad27d 100644 (file)
@@ -218,9 +218,7 @@ int MAIN(int argc, char **argv)
     char *checkhost = NULL;
     char *checkemail = NULL;
     char *checkip = NULL;
-#ifndef OPENSSL_NO_ENGINE
     char *engine = NULL;
-#endif
 
     reqfile = 0;
 
@@ -501,9 +499,7 @@ int MAIN(int argc, char **argv)
             BIO_printf(bio_err, "%s", *pp);
         goto end;
     }
-#ifndef OPENSSL_NO_ENGINE
     e = setup_engine(bio_err, engine, 0);
-#endif
 
     if (need_rand)
         app_RAND_load_file(NULL, bio_err, 0);
@@ -1040,6 +1036,7 @@ int MAIN(int argc, char **argv)
     ASN1_INTEGER_free(sno);
     sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
     sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
+    release_engine(e);
     if (passin)
         OPENSSL_free(passin);
     apps_shutdown();