Use apps_shutdown() in all applications, in case someone decides not
authorRichard Levitte <levitte@openssl.org>
Sat, 23 Jun 2001 16:37:32 +0000 (16:37 +0000)
committerRichard Levitte <levitte@openssl.org>
Sat, 23 Jun 2001 16:37:32 +0000 (16:37 +0000)
to go the monolith way (does anyone do that these days?).

NOTE: a few applications are missing in this commit.  I've a few more
changes in them that I haven't tested yet.

26 files changed:
apps/asn1pars.c
apps/ciphers.c
apps/crl.c
apps/crl2p7.c
apps/dgst.c
apps/dh.c
apps/dhparam.c
apps/dsa.c
apps/dsaparam.c
apps/enc.c
apps/engine.c
apps/errstr.c
apps/gendh.c
apps/gendsa.c
apps/genrsa.c
apps/passwd.c
apps/pkcs7.c
apps/rand.c
apps/rsa.c
apps/s_client.c
apps/s_server.c
apps/s_time.c
apps/sess_id.c
apps/speed.c
apps/version.c
apps/x509.c

index 108ed7daa0bde85b639f03ba494be8dcec119e2e..4918bcb1c0654d5a90de194a8e91db7ac5f0f8ac 100644 (file)
@@ -329,6 +329,7 @@ end:
        if (at != NULL) ASN1_TYPE_free(at);
        if (osk != NULL) sk_free(osk);
        OBJ_cleanup();
+       apps_shutdown();
        EXIT(ret);
        }
 
index c3bd859d68c153cfc0a7ba404c993bb5909f365b..2d6e104790cf9440193bf2e3db427e3dbdce396a 100644 (file)
@@ -202,6 +202,7 @@ end:
        if (ctx != NULL) SSL_CTX_free(ctx);
        if (ssl != NULL) SSL_free(ssl);
        if (STDout != NULL) BIO_free_all(STDout);
+       apps_shutdown();
        EXIT(ret);
        }
 
index fb36ed5d02bcb06834feef59bf782fbc4f0479c6..82ef8ce1f62c145d8265a91ea1acc8e38e61f3cc 100644 (file)
@@ -364,6 +364,7 @@ end:
                X509_STORE_CTX_cleanup(&ctx);
                X509_STORE_free(store);
        }
+       apps_shutdown();
        EXIT(ret);
        }
 
index 36d8afee6ff376eb0bdc3166acd1c2b3d6e44866..8729068462baa840f934e5c13bac4d38c784767c 100644 (file)
@@ -166,7 +166,8 @@ bad:
                BIO_printf(bio_err," -certfile arg  certificates file of chain to a trusted CA\n");
                BIO_printf(bio_err,"                (can be used more than once)\n");
                BIO_printf(bio_err," -nocrl         no crl to load, just certs from '-certfile'\n");
-               EXIT(1);
+               ret = 1;
+               goto end;
                }
 
        ERR_load_crypto_strings();
@@ -278,6 +279,7 @@ end:
        if (p7 != NULL) PKCS7_free(p7);
        if (crl != NULL) X509_CRL_free(crl);
 
+       apps_shutdown();
        EXIT(ret);
        }
 
index 1fbef6bed21ef28716cd6eb8e64d8aebdb85c594..e3edf302c3ac9c953e61a02ca3bfb6ae64896884 100644 (file)
@@ -347,6 +347,7 @@ end:
        EVP_PKEY_free(sigkey);
        if(sigbuf) OPENSSL_free(sigbuf);
        if (bmd != NULL) BIO_free(bmd);
+       apps_shutdown();
        EXIT(err);
        }
 
index 20581f66495871df3026f067f771efdf14e76362..603ea5b496d8f4e315db317cff4308b4eeafd8c7 100644 (file)
--- a/apps/dh.c
+++ b/apps/dh.c
@@ -330,6 +330,7 @@ end:
        if (in != NULL) BIO_free(in);
        if (out != NULL) BIO_free_all(out);
        if (dh != NULL) DH_free(dh);
+       apps_shutdown();
        EXIT(ret);
        }
 #endif
index 51aee97d258a23819b3a0de5975d8468fcac1065..00cf87bf6d47ff9a14687b6210f4ef889a22d6f0 100644 (file)
@@ -516,6 +516,7 @@ end:
        if (in != NULL) BIO_free(in);
        if (out != NULL) BIO_free_all(out);
        if (dh != NULL) DH_free(dh);
+       apps_shutdown();
        EXIT(ret);
        }
 
index f18d13da03ca06a5fe2ebda5190b1530abf2f3bd..09ddb23996eb0cc4fb732ff14ed209f5c629c620 100644 (file)
@@ -304,6 +304,7 @@ end:
        if(dsa != NULL) DSA_free(dsa);
        if(passin) OPENSSL_free(passin);
        if(passout) OPENSSL_free(passout);
+       apps_shutdown();
        EXIT(ret);
        }
 #endif
index 983cd04329aa8682873351fc9ffa96491a312751..4196413217f0e4499528589e06ecdcff23c71265 100644 (file)
@@ -368,6 +368,7 @@ end:
        if (in != NULL) BIO_free(in);
        if (out != NULL) BIO_free_all(out);
        if (dsa != NULL) DSA_free(dsa);
+       apps_shutdown();
        EXIT(ret);
        }
 
index ac3014b24ce361297d9616fb0a81ac70046843b7..49cae7579c391a938e08e55646e100fd8506d398 100644 (file)
@@ -575,6 +575,7 @@ end:
        if (benc != NULL) BIO_free(benc);
        if (b64 != NULL) BIO_free(b64);
        if(pass) OPENSSL_free(pass);
+       apps_shutdown();
        EXIT(ret);
        }
 
index 537aefd131b5b3a886e8e4d2c0f174231f18a46b..1308b6b7f163a8fa492bf14ec85077b275de34d4 100644 (file)
@@ -486,5 +486,6 @@ end:
        sk_pop_free(pre_cmds, identity);
        sk_pop_free(post_cmds, identity);
        if (bio_out != NULL) BIO_free_all(bio_out);
+       apps_shutdown();
        EXIT(ret);
        }
index c411effcd03d4499cff5fffb96f6fd384b5c2fec..fedb568d686988ce9da114c63495227f2b927bfe 100644 (file)
@@ -121,5 +121,6 @@ int MAIN(int argc, char **argv)
                        ret++;
                        }
                }
+       apps_shutdown();
        EXIT(ret);
        }
index 14928d84a3e724b9378ed462463092a9515c5a41..e8f8493c5f49ba9c42f2db522c8a7a7e55ec5861 100644 (file)
@@ -195,6 +195,7 @@ end:
                ERR_print_errors(bio_err);
        if (out != NULL) BIO_free_all(out);
        if (dh != NULL) DH_free(dh);
+       apps_shutdown();
        EXIT(ret);
        }
 
index 57ef0da46d99e96dc617538aee588d5b14efec21..b990eecbd24b82f2b81e1d1f4d24e6479e9fa5b1 100644 (file)
@@ -231,6 +231,7 @@ end:
        if (out != NULL) BIO_free_all(out);
        if (dsa != NULL) DSA_free(dsa);
        if(passout) OPENSSL_free(passout);
+       apps_shutdown();
        EXIT(ret);
        }
 #endif
index dfcb523ebabae0375308753a2494b7eb25d65043..a5669de7ce38f6322fbb220a614ff5a6a4af06c6 100644 (file)
@@ -242,6 +242,7 @@ err:
        if(passout) OPENSSL_free(passout);
        if (ret != 0)
                ERR_print_errors(bio_err);
+       apps_shutdown();
        EXIT(ret);
        }
 
index 750a3cb39d5b7d62952d4b6be30c25215c467b10..5e7195f13b65be3ff91d79997d41c5cb43725766 100644 (file)
@@ -289,6 +289,7 @@ err:
                BIO_free(in);
        if (out)
                BIO_free_all(out);
+       apps_shutdown();
        EXIT(ret);
        }
 
index f3df25fe8b04ef7591bc82a4575321ab8eadf531..a0b21341f5e028d4dff946f23781072815677547 100644 (file)
@@ -163,7 +163,8 @@ bad:
                BIO_printf(bio_err," -text         print full details of certificates\n");
                BIO_printf(bio_err," -noout        don't output encoded data\n");
                BIO_printf(bio_err," -engine e     use engine e, possibly a hardware device.\n");
-               EXIT(1);
+               ret = 1;
+               goto end;
                }
 
        ERR_load_crypto_strings();
@@ -300,5 +301,6 @@ end:
        if (p7 != NULL) PKCS7_free(p7);
        if (in != NULL) BIO_free(in);
        if (out != NULL) BIO_free_all(out);
+       apps_shutdown();
        EXIT(ret);
        }
index 10adf0e95d81e3f3810987b9ee169afb145e5769..faba057b772d9107f4396e4634990346fcfa6d3a 100644 (file)
@@ -157,5 +157,6 @@ err:
        ERR_print_errors(bio_err);
        if (out)
                BIO_free_all(out);
+       apps_shutdown();
        EXIT(ret);
        }
index 5b671e135ec3b5e85ff746a67431c0c4dbcb0035..18964fedd2f00ed8428bcb30ea64acf549c06f77 100644 (file)
@@ -400,6 +400,7 @@ end:
        if(rsa != NULL) RSA_free(rsa);
        if(passin) OPENSSL_free(passin);
        if(passout) OPENSSL_free(passout);
+       apps_shutdown();
        EXIT(ret);
        }
 #else /* !OPENSSL_NO_RSA */
index 009aa83e4eefb466b7690be99268f4f9ada1a682..ac5d2f10c20f597ba98f76386b15cf9ca03b9e31 100644 (file)
@@ -803,6 +803,7 @@ end:
                BIO_free(bio_c_out);
                bio_c_out=NULL;
                }
+       apps_shutdown();
        EXIT(ret);
        }
 
index 11971cb8c98c855a07ab4d57dfd20bff517e7282..6ed23490f10f2ba9ed58cd6ddad9b749c794b2f1 100644 (file)
@@ -799,6 +799,7 @@ end:
                BIO_free(bio_s_out);
                bio_s_out=NULL;
                }
+       apps_shutdown();
        EXIT(ret);
        }
 
index 3bdf898882582a24ec190cb8f9ee37f358a2bf71..0e2f4566c9cd1ddeea7b9a52b1e241314bdd423b 100644 (file)
@@ -443,7 +443,6 @@ int MAIN(int argc, char **argv)
 
        if (tm_cipher == NULL ) {
                fprintf( stderr, "No CIPHER specified\n" );
-/*             EXIT(1); */
        }
 
        if (!(perform & 1)) goto next;
@@ -610,6 +609,7 @@ end:
                SSL_CTX_free(tm_ctx);
                tm_ctx=NULL;
                }
+       apps_shutdown();
        EXIT(ret);
        }
 
index 7f5c55b90180816fb64d3d959b1eac1dc65b0cbf..41c3b3f4a3ab649ba05ae3580b8ecbdc7bc292d3 100644 (file)
@@ -272,6 +272,7 @@ bad:
 end:
        if (out != NULL) BIO_free_all(out);
        if (x != NULL) SSL_SESSION_free(x);
+       apps_shutdown();
        EXIT(ret);
        }
 
index dbf7732a2a6fa0e39df9cbdbee7e762927bd911e..a7842cecd042fe1111305834c23bfc3983d26263 100644 (file)
@@ -1470,6 +1470,7 @@ end:
                if (dsa_key[i] != NULL)
                        DSA_free(dsa_key[i]);
 #endif
+       apps_shutdown();
        EXIT(mret);
        }
 
index efa0d0d493b7a41c67c5e2cab30bbbd01e16f788..65b5935c9c5922fa3bea1c073171882d24820e50 100644 (file)
@@ -131,5 +131,6 @@ int MAIN(int argc, char **argv)
        if (cflags)  printf("%s\n",SSLeay_version(SSLEAY_CFLAGS));
        if (dir)  printf("%s\n",SSLeay_version(SSLEAY_DIR));
 end:
+       apps_shutdown();
        EXIT(ret);
        }
index b2e4ec631f9526967433c21a554645453642503e..8a392d813a3515c51b650adde75ad51d65b7643c 100644 (file)
@@ -1009,6 +1009,7 @@ end:
        sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
        sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
        if (passin) OPENSSL_free(passin);
+       apps_shutdown();
        EXIT(ret);
        }