Fix memory leak in the apps
authorKurt Roeckx <kurt@roeckx.be>
Sun, 7 Dec 2014 21:25:39 +0000 (22:25 +0100)
committerKurt Roeckx <kurt@roeckx.be>
Tue, 30 Dec 2014 16:00:22 +0000 (17:00 +0100)
The BIO_free() allocated ex_data again that we already freed.

Reviewed-by: Richard Levitte <levitte@openssl.org>
apps/openssl.c

index 71e1e48ece40579234bf4578c2d2b02b6fc40b3c..5372459456a37ea34845c7208bcbd64753d48b2a 100644 (file)
@@ -435,9 +435,7 @@ end:
        if (prog != NULL) lh_FUNCTION_free(prog);
        if (arg.data != NULL) OPENSSL_free(arg.data);
 
-       apps_shutdown();
 
-       CRYPTO_mem_leaks(bio_err);
        if (bio_err != NULL)
                {
                BIO_free(bio_err);
@@ -450,6 +448,9 @@ end:
                OPENSSL_free(Argv);
                }
 #endif
+       apps_shutdown();
+       CRYPTO_mem_leaks(bio_err);
+
        OPENSSL_EXIT(ret);
        }