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


test/evp_test.c:1803:1: start of procedure encode_test_run()
1801.   }
1802.   
1803. > static int encode_test_run(EVP_TEST *t)
1804.   {
1805.       ENCODE_DATA *edata = t->data;

test/evp_test.c:1805:5: 
1803.   static int encode_test_run(EVP_TEST *t)
1804.   {
1805. >     ENCODE_DATA *edata = t->data;
1806.       unsigned char *encode_out = NULL, *decode_out = NULL;
1807.       int output_len, chunk_len;

test/evp_test.c:1806:5: 
1804.   {
1805.       ENCODE_DATA *edata = t->data;
1806. >     unsigned char *encode_out = NULL, *decode_out = NULL;
1807.       int output_len, chunk_len;
1808.       EVP_ENCODE_CTX *decode_ctx;

test/evp_test.c:1810:10: 
1808.       EVP_ENCODE_CTX *decode_ctx;
1809.   
1810. >     if (!TEST_ptr(decode_ctx = EVP_ENCODE_CTX_new())) {
1811.           t->err = "INTERNAL_ERROR";
1812.           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:462:1: start of procedure test_ptr()
  460.   }
  461.   
  462. > int test_ptr(const char *file, int line, const char *s, const void *p)
  463.   {
  464.       if (p != NULL)

test/testutil/tests.c:464:9: Taking true branch
  462.   int test_ptr(const char *file, int line, const char *s, const void *p)
  463.   {
  464.       if (p != NULL)
                 ^
  465.           return 1;
  466.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:465:9: 
  463.   {
  464.       if (p != NULL)
  465. >         return 1;
  466.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  467.       return 0;

test/testutil/tests.c:468:1: return from a call to test_ptr
  466.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  467.       return 0;
  468. > }
  469.   
  470.   int test_true(const char *file, int line, const char *s, int b)

test/evp_test.c:1810:10: Taking false branch
1808.       EVP_ENCODE_CTX *decode_ctx;
1809.   
1810.       if (!TEST_ptr(decode_ctx = EVP_ENCODE_CTX_new())) {
                 ^
1811.           t->err = "INTERNAL_ERROR";
1812.           goto err;

test/evp_test.c:1815:9: Taking true branch
1813.       }
1814.   
1815.       if (edata->encoding == BASE64_CANONICAL_ENCODING) {
                ^
1816.           EVP_ENCODE_CTX *encode_ctx;
1817.   

test/evp_test.c:1818:14: 
1816.           EVP_ENCODE_CTX *encode_ctx;
1817.   
1818. >         if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
1819.                   || !TEST_ptr(encode_out =
1820.                           OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->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:462:1: start of procedure test_ptr()
  460.   }
  461.   
  462. > int test_ptr(const char *file, int line, const char *s, const void *p)
  463.   {
  464.       if (p != NULL)

test/testutil/tests.c:464:9: Taking true branch
  462.   int test_ptr(const char *file, int line, const char *s, const void *p)
  463.   {
  464.       if (p != NULL)
                 ^
  465.           return 1;
  466.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:465:9: 
  463.   {
  464.       if (p != NULL)
  465. >         return 1;
  466.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  467.       return 0;

test/testutil/tests.c:468:1: return from a call to test_ptr
  466.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  467.       return 0;
  468. > }
  469.   
  470.   int test_true(const char *file, int line, const char *s, int b)

test/evp_test.c:1818:14: Taking false branch
1816.           EVP_ENCODE_CTX *encode_ctx;
1817.   
1818.           if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
                     ^
1819.                   || !TEST_ptr(encode_out =
1820.                           OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len))))

test/evp_test.c:1819:21: 
1817.   
1818.           if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
1819. >                 || !TEST_ptr(encode_out =
1820.                           OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len))))
1821.               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:462:1: start of procedure test_ptr()
  460.   }
  461.   
  462. > int test_ptr(const char *file, int line, const char *s, const void *p)
  463.   {
  464.       if (p != NULL)

test/testutil/tests.c:464:9: Taking false branch
  462.   int test_ptr(const char *file, int line, const char *s, const void *p)
  463.   {
  464.       if (p != NULL)
                 ^
  465.           return 1;
  466.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:466:5: 
  464.       if (p != NULL)
  465.           return 1;
  466. >     test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  467.       return 0;
  468.   }

test/testutil/tests.c:347:1: start of procedure test_fail_message()
    345.   }
    346.   
    347. > static void test_fail_message(const char *prefix, const char *file,
    348.                                 int line, const char *type,
    349.                                 const char *left, const char *right,

test/testutil/tests.c:354:5: 
    352.       va_list ap;
    353.   
    354. >     va_start(ap, fmt);
    355.       test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap);
    356.       va_end(ap);

test/testutil/tests.c:355:5: Skipping test_fail_message_va(): empty list of specs
    353.   
    354.       va_start(ap, fmt);
    355.       test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap);
               ^
    356.       va_end(ap);
    357.   }

test/testutil/tests.c:356:5: 
    354.       va_start(ap, fmt);
    355.       test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap);
    356. >     va_end(ap);
    357.   }
    358.   

test/testutil/tests.c:357:1: return from a call to test_fail_message
    355.       test_fail_message_va(prefix, file, line, type, left, right, op, fmt, ap);
    356.       va_end(ap);
    357. > }
    358.   
    359.   void test_info_c90(const char *desc, ...)

test/testutil/tests.c:467:5: 
  465.           return 1;
  466.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  467. >     return 0;
  468.   }
  469.   

test/testutil/tests.c:468:1: return from a call to test_ptr
  466.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  467.       return 0;
  468. > }
  469.   
  470.   int test_true(const char *file, int line, const char *s, int b)

test/evp_test.c:1819:21: Taking true branch
1817.   
1818.           if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
1819.                   || !TEST_ptr(encode_out =
                            ^
1820.                           OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len))))
1821.               goto err;
