Make it so we can dynamically enable memory allocation debugging through the
[openssl.git] / apps / openssl.c
index 934a1c176d42559fa4cc0cb0198194da4b72ae06..c3680c5e711661b15c4edbacda642cf7c04adc13 100644 (file)
@@ -101,6 +101,8 @@ int main(int Argc, char *Argv[])
        arg.data=NULL;
        arg.count=0;
 
+       if (getenv("OPENSSL_DEBUG_MEMORY") != NULL)
+               CRYPTO_malloc_debug_init();
        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
 
        apps_startup();
@@ -201,12 +203,12 @@ end:
                config=NULL;
                }
        if (prog != NULL) lh_free(prog);
-       if (arg.data != NULL) Free(arg.data);
+       if (arg.data != NULL) OPENSSL_free(arg.data);
        ERR_remove_state(0);
 
        EVP_cleanup();
        ERR_free_strings();
-
+       
        CRYPTO_mem_leaks(bio_err);
        if (bio_err != NULL)
                {