test/mdc2test.c:67: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 49, column 9 is not reachable after line 67, column 5.
Showing all 53 steps of the trace


test/mdc2test.c:37:1: start of procedure test_mdc2()
35.   };
36.   
37. > static int test_mdc2(void)
38.   {
39.       int testresult = 0;

test/mdc2test.c:39:5: 
37.   static int test_mdc2(void)
38.   {
39. >     int testresult = 0;
40.       unsigned char md[MDC2_DIGEST_LENGTH];
41.       EVP_MD_CTX *c;

test/mdc2test.c:42:5: 
40.       unsigned char md[MDC2_DIGEST_LENGTH];
41.       EVP_MD_CTX *c;
42. >     static char text[] = "Now is the time for all ";
43.       size_t tlen = strlen(text);
44.   

test/mdc2test.c:43:5: 
41.       EVP_MD_CTX *c;
42.       static char text[] = "Now is the time for all ";
43. >     size_t tlen = strlen(text);
44.   
45.   # ifdef CHARSET_EBCDIC

test/mdc2test.c:49:5: 
47.   # endif
48.   
49. >     c = EVP_MD_CTX_new();
50.       if (!TEST_ptr(c)
51.           || !TEST_true(EVP_DigestInit_ex(c, EVP_mdc2(), NULL))

crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new()
  42.   }
  43.   
  44. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:46:5: 
  44.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47.   }
  48.   

crypto/mem.c:186:1: start of procedure CRYPTO_zalloc()
    184.   }
    185.   
    186. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    187.   {
    188.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:188:5: 
    186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    187.   {
    188. >     void *ret = CRYPTO_malloc(num, file, line);
    189.   
    190.       FAILTEST();

crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
      156.   #endif
      157.   
      158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      159.   {
      160.       void *ret = NULL;

crypto/mem.c:160:5: 
      158.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      159.   {
      160. >     void *ret = NULL;
      161.   
      162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:162:9: Taking false branch
      160.       void *ret = NULL;
      161.   
      162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      163.           return malloc_impl(num, file, line);
      164.   

crypto/mem.c:165:9: Taking false branch
      163.           return malloc_impl(num, file, line);
      164.   
      165.       if (num == 0)
                     ^
      166.           return NULL;
      167.   

crypto/mem.c:169:5: 
      167.   
      168.       FAILTEST();
      169. >     allow_customize = 0;
      170.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      171.       if (call_malloc_debug) {

crypto/mem.c:179:5: 
      177.       }
      178.   #else
      179. >     osslargused(file); osslargused(line);
      180.       ret = malloc(num);
      181.   #endif

crypto/mem.c:179:24: 
      177.       }
      178.   #else
      179. >     osslargused(file); osslargused(line);
      180.       ret = malloc(num);
      181.   #endif

crypto/mem.c:180:5: 
      178.   #else
      179.       osslargused(file); osslargused(line);
      180. >     ret = malloc(num);
      181.   #endif
      182.   

crypto/mem.c:183:5: 
      181.   #endif
      182.   
      183. >     return ret;
      184.   }
      185.   

crypto/mem.c:184:1: return from a call to CRYPTO_malloc
      182.   
      183.       return ret;
      184. > }
      185.   
      186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:191:9: Taking true branch
    189.   
    190.       FAILTEST();
    191.       if (ret != NULL)
                   ^
    192.           memset(ret, 0, num);
    193.       return ret;

crypto/mem.c:192:9: 
    190.       FAILTEST();
    191.       if (ret != NULL)
    192. >         memset(ret, 0, num);
    193.       return ret;
    194.   }

crypto/mem.c:193:5: 
    191.       if (ret != NULL)
    192.           memset(ret, 0, num);
    193. >     return ret;
    194.   }
    195.   

crypto/mem.c:194:1: return from a call to CRYPTO_zalloc
    192.           memset(ret, 0, num);
    193.       return ret;
    194. > }
    195.   
    196.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47. > }
  48.   
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

test/mdc2test.c:50:10: 
48.   
49.       c = EVP_MD_CTX_new();
50. >     if (!TEST_ptr(c)
51.           || !TEST_true(EVP_DigestInit_ex(c, EVP_mdc2(), NULL))
52.           || !TEST_true(EVP_DigestUpdate(c, (unsigned char *)text, tlen))

test/testutil/tests.c:217:1: start of procedure test_ptr()
  215.   }
  216.   
  217. > int test_ptr(const char *file, int line, const char *s, const void *p)
  218.   {
  219.       if (p != NULL)

test/testutil/tests.c:219:9: Taking true branch
  217.   int test_ptr(const char *file, int line, const char *s, const void *p)
  218.   {
  219.       if (p != NULL)
                 ^
  220.           return 1;
  221.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:220:9: 
  218.   {
  219.       if (p != NULL)
  220. >         return 1;
  221.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  222.       return 0;

test/testutil/tests.c:223:1: return from a call to test_ptr
  221.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  222.       return 0;
  223. > }
  224.   
  225.   int test_true(const char *file, int line, const char *s, int b)

test/mdc2test.c:50:10: Taking false branch
48.   
49.       c = EVP_MD_CTX_new();
50.       if (!TEST_ptr(c)
               ^
51.           || !TEST_true(EVP_DigestInit_ex(c, EVP_mdc2(), NULL))
52.           || !TEST_true(EVP_DigestUpdate(c, (unsigned char *)text, tlen))

test/mdc2test.c:51:13: 
49.       c = EVP_MD_CTX_new();
50.       if (!TEST_ptr(c)
51. >         || !TEST_true(EVP_DigestInit_ex(c, EVP_mdc2(), NULL))
52.           || !TEST_true(EVP_DigestUpdate(c, (unsigned char *)text, tlen))
53.           || !TEST_true(EVP_DigestFinal_ex(c, &(md[0]), NULL))

crypto/evp/m_mdc2.c:51:1: start of procedure EVP_mdc2()
  49.   };
  50.   
  51. > const EVP_MD *EVP_mdc2(void)
  52.   {
  53.       return (&mdc2_md);

crypto/evp/m_mdc2.c:53:5: 
  51.   const EVP_MD *EVP_mdc2(void)
  52.   {
  53. >     return (&mdc2_md);
  54.   }
  55.   #endif

crypto/evp/m_mdc2.c:54:1: return from a call to EVP_mdc2
  52.   {
  53.       return (&mdc2_md);
  54. > }
  55.   #endif

test/mdc2test.c:51:13: Condition is false
49.       c = EVP_MD_CTX_new();
50.       if (!TEST_ptr(c)
51.           || !TEST_true(EVP_DigestInit_ex(c, EVP_mdc2(), NULL))
                  ^
52.           || !TEST_true(EVP_DigestUpdate(c, (unsigned char *)text, tlen))
53.           || !TEST_true(EVP_DigestFinal_ex(c, &(md[0]), NULL))

test/testutil/tests.c:225:1: start of procedure test_true()
  223.   }
  224.   
  225. > int test_true(const char *file, int line, const char *s, int b)
  226.   {
  227.       if (b)

test/testutil/tests.c:227:9: Taking false branch
  225.   int test_true(const char *file, int line, const char *s, int b)
  226.   {
  227.       if (b)
                 ^
  228.           return 1;
  229.       test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");

test/testutil/tests.c:229:5: Skipping test_fail_message(): empty list of specs
  227.       if (b)
  228.           return 1;
  229.       test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");
             ^
  230.       return 0;
  231.   }

test/testutil/tests.c:230:5: 
  228.           return 1;
  229.       test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");
  230. >     return 0;
  231.   }
  232.   

test/testutil/tests.c:231:1: return from a call to test_true
  229.       test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");
  230.       return 0;
  231. > }
  232.   
  233.   int test_false(const char *file, int line, const char *s, int b)

test/mdc2test.c:51:13: Taking true branch
49.       c = EVP_MD_CTX_new();
50.       if (!TEST_ptr(c)
51.           || !TEST_true(EVP_DigestInit_ex(c, EVP_mdc2(), NULL))
                  ^
52.           || !TEST_true(EVP_DigestUpdate(c, (unsigned char *)text, tlen))
53.           || !TEST_true(EVP_DigestFinal_ex(c, &(md[0]), NULL))

test/mdc2test.c:66:2: 
64.   
65.       testresult = 1;
66. >  end:
67.       EVP_MD_CTX_free(c);
68.       return testresult;

test/mdc2test.c:67:5: 
65.       testresult = 1;
66.    end:
67. >     EVP_MD_CTX_free(c);
68.       return testresult;
69.   }

crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free()
  47.   }
  48.   
  49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
            ^
  52.       OPENSSL_free(ctx);
  53.   }

crypto/evp/digest.c:52:5: 
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
  52. >     OPENSSL_free(ctx);
  53.   }
  54.   

crypto/mem.c:253:1: start of procedure CRYPTO_free()
    251.   }
    252.   
    253. > void CRYPTO_free(void *str, const char *file, int line)
    254.   {
    255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:255:9: Taking true branch
    253.   void CRYPTO_free(void *str, const char *file, int line)
    254.   {
    255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    256.           free_impl(str, file, line);
    257.           return;

crypto/mem.c:255:30: Taking true branch
    253.   void CRYPTO_free(void *str, const char *file, int line)
    254.   {
    255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    256.           free_impl(str, file, line);
    257.           return;

crypto/mem.c:256:9: Skipping __function_pointer__(): unresolved function pointer
    254.   {
    255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    256.           free_impl(str, file, line);
                   ^
    257.           return;
    258.       }

crypto/mem.c:257:9: 
    255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    256.           free_impl(str, file, line);
    257. >         return;
    258.       }
    259.   

crypto/mem.c:271:1: return from a call to CRYPTO_free
    269.       free(str);
    270.   #endif
    271. > }
    272.   
    273.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free
  51.       EVP_MD_CTX_reset(ctx);
  52.       OPENSSL_free(ctx);
  53. > }
  54.   
  55.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
