test/evp_test.c:1550: error: MEMORY_LEAK
  memory dynamically allocated to `encode_ctx` by call to `EVP_ENCODE_CTX_new()` at line 1549, column 14 is not reachable after line 1550, column 21.
Showing all 72 steps of the trace


test/evp_test.c:1534:1: start of procedure encode_test_run()
1532.   }
1533.   
1534. > static int encode_test_run(EVP_TEST *t)
1535.   {
1536.       ENCODE_DATA *expected = t->data;

test/evp_test.c:1536:5: 
1534.   static int encode_test_run(EVP_TEST *t)
1535.   {
1536. >     ENCODE_DATA *expected = t->data;
1537.       unsigned char *encode_out = NULL, *decode_out = NULL;
1538.       int output_len, chunk_len;

test/evp_test.c:1537:5: 
1535.   {
1536.       ENCODE_DATA *expected = t->data;
1537. >     unsigned char *encode_out = NULL, *decode_out = NULL;
1538.       int output_len, chunk_len;
1539.       EVP_ENCODE_CTX *decode_ctx;

test/evp_test.c:1541:10: 
1539.       EVP_ENCODE_CTX *decode_ctx;
1540.   
1541. >     if (!TEST_ptr(decode_ctx = EVP_ENCODE_CTX_new())) {
1542.           t->err = "INTERNAL_ERROR";
1543.           goto err;

crypto/evp/encode.c:96:1: start of procedure EVP_ENCODE_CTX_new()
  94.   #endif
  95.   
  96. > EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
  97.   {
  98.       return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));

crypto/evp/encode.c:98:5: 
  96.   EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
  97.   {
  98. >     return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
  99.   }
  100.   

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/encode.c:99:1: return from a call to EVP_ENCODE_CTX_new
  97.   {
  98.       return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
  99. > }
  100.   
  101.   void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)

test/testutil/tests.c:607:1: start of procedure test_ptr()
  605.   }
  606.   
  607. > int test_ptr(const char *file, int line, const char *s, const void *p)
  608.   {
  609.       if (p != NULL)

test/testutil/tests.c:609:9: Taking true branch
  607.   int test_ptr(const char *file, int line, const char *s, const void *p)
  608.   {
  609.       if (p != NULL)
                 ^
  610.           return 1;
  611.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:610:9: 
  608.   {
  609.       if (p != NULL)
  610. >         return 1;
  611.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  612.       return 0;

test/testutil/tests.c:613:1: return from a call to test_ptr
  611.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  612.       return 0;
  613. > }
  614.   
  615.   int test_true(const char *file, int line, const char *s, int b)

test/evp_test.c:1541:10: Taking false branch
1539.       EVP_ENCODE_CTX *decode_ctx;
1540.   
1541.       if (!TEST_ptr(decode_ctx = EVP_ENCODE_CTX_new())) {
                 ^
1542.           t->err = "INTERNAL_ERROR";
1543.           goto err;

test/evp_test.c:1546:9: Taking true branch
1544.       }
1545.   
1546.       if (expected->encoding == BASE64_CANONICAL_ENCODING) {
                ^
1547.           EVP_ENCODE_CTX *encode_ctx;
1548.   

test/evp_test.c:1549:14: 
1547.           EVP_ENCODE_CTX *encode_ctx;
1548.   
1549. >         if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
1550.                   || !TEST_ptr(encode_out =
1551.                           OPENSSL_malloc(EVP_ENCODE_LENGTH(expected->input_len))))

crypto/evp/encode.c:96:1: start of procedure EVP_ENCODE_CTX_new()
  94.   #endif
  95.   
  96. > EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
  97.   {
  98.       return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));

crypto/evp/encode.c:98:5: 
  96.   EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
  97.   {
  98. >     return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
  99.   }
  100.   

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/encode.c:99:1: return from a call to EVP_ENCODE_CTX_new
  97.   {
  98.       return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
  99. > }
  100.   
  101.   void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)

test/testutil/tests.c:607:1: start of procedure test_ptr()
  605.   }
  606.   
  607. > int test_ptr(const char *file, int line, const char *s, const void *p)
  608.   {
  609.       if (p != NULL)

test/testutil/tests.c:609:9: Taking true branch
  607.   int test_ptr(const char *file, int line, const char *s, const void *p)
  608.   {
  609.       if (p != NULL)
                 ^
  610.           return 1;
  611.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:610:9: 
  608.   {
  609.       if (p != NULL)
  610. >         return 1;
  611.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  612.       return 0;

test/testutil/tests.c:613:1: return from a call to test_ptr
  611.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  612.       return 0;
  613. > }
  614.   
  615.   int test_true(const char *file, int line, const char *s, int b)

test/evp_test.c:1549:14: Taking false branch
1547.           EVP_ENCODE_CTX *encode_ctx;
1548.   
1549.           if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
                     ^
1550.                   || !TEST_ptr(encode_out =
1551.                           OPENSSL_malloc(EVP_ENCODE_LENGTH(expected->input_len))))

test/evp_test.c:1550:21: 
1548.   
1549.           if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
1550. >                 || !TEST_ptr(encode_out =
1551.                           OPENSSL_malloc(EVP_ENCODE_LENGTH(expected->input_len))))
1552.               goto err;

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 true 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:162:32: Taking true 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:163:9: Skipping __function_pointer__(): unresolved function pointer
  161.   
  162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
  163.           return malloc_impl(num, file, line);
                 ^
  164.   
  165.       if (num == 0)

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)

test/testutil/tests.c:607:1: start of procedure test_ptr()
  605.   }
  606.   
  607. > int test_ptr(const char *file, int line, const char *s, const void *p)
  608.   {
  609.       if (p != NULL)

test/testutil/tests.c:609:9: Taking false branch
  607.   int test_ptr(const char *file, int line, const char *s, const void *p)
  608.   {
  609.       if (p != NULL)
                 ^
  610.           return 1;
  611.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:611:5: 
  609.       if (p != NULL)
  610.           return 1;
  611. >     test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  612.       return 0;
  613.   }

test/testutil/tests.c:492:1: start of procedure test_fail_message()
    490.   }
    491.   
    492. > static void test_fail_message(const char *prefix, const char *file,
    493.                                 int line, const char *type,
    494.                                 const char *left, const char *right,

test/testutil/tests.c:499:5: 
    497.       va_list ap;
    498.   
    499. >     va_start(ap, fmt);
    500.       test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap);
    501.       va_end(ap);

test/testutil/tests.c:500:5: Skipping test_fail_message_va(): empty list of specs
    498.   
    499.       va_start(ap, fmt);
    500.       test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap);
               ^
    501.       va_end(ap);
    502.   }

test/testutil/tests.c:501:5: 
    499.       va_start(ap, fmt);
    500.       test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap);
    501. >     va_end(ap);
    502.   }
    503.   

test/testutil/tests.c:502:1: return from a call to test_fail_message
    500.       test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap);
    501.       va_end(ap);
    502. > }
    503.   
    504.   void test_info_c90(const char *desc, ...)

test/testutil/tests.c:612:5: 
  610.           return 1;
  611.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  612. >     return 0;
  613.   }
  614.   

test/testutil/tests.c:613:1: return from a call to test_ptr
  611.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  612.       return 0;
  613. > }
  614.   
  615.   int test_true(const char *file, int line, const char *s, int b)

test/evp_test.c:1550:21: Taking true branch
1548.   
1549.           if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
1550.                   || !TEST_ptr(encode_out =
                            ^
1551.                           OPENSSL_malloc(EVP_ENCODE_LENGTH(expected->input_len))))
1552.               goto err;
