summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b78e502)
fix a typo and add cleanup operations. This also switches on memory leak
checking (which is how the rest was found).
+ EVP_CIPHER_CTX_init(&ctx);
if(!EVP_EncryptInit(&ctx,c,key,iv))
{
fprintf(stderr,"EncryptInit failed\n");
if(!EVP_EncryptInit(&ctx,c,key,iv))
{
fprintf(stderr,"EncryptInit failed\n");
}
if(!EVP_DigestFinal(&ctx,md,&mdn))
{
}
if(!EVP_DigestFinal(&ctx,md,&mdn))
{
- fprintf(stderr,"DigestUpdate failed\n");
+ fprintf(stderr,"DigestFinal failed\n");
+ EVP_MD_CTX_cleanup(&ctx);
fprintf(stderr,"%s <test file>\n",argv[0]);
exit(1);
}
fprintf(stderr,"%s <test file>\n",argv[0]);
exit(1);
}
+ CRYPTO_malloc_debug_init();
+ CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
+ ENGINE_cleanup();
+ EVP_cleanup();
+ CRYPTO_cleanup_all_ex_data();
+ ERR_remove_state(0);
+ ERR_free_strings();
+ CRYPTO_mem_leaks_fp(stderr);