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


test/evp_test.c:1529:1: start of procedure encode_test_run()
1527.   }
1528.   
1529. > static int encode_test_run(EVP_TEST *t)
1530.   {
1531.       ENCODE_DATA *expected = t->data;

test/evp_test.c:1531:5: 
1529.   static int encode_test_run(EVP_TEST *t)
1530.   {
1531. >     ENCODE_DATA *expected = t->data;
1532.       unsigned char *encode_out = NULL, *decode_out = NULL;
1533.       int output_len, chunk_len;

test/evp_test.c:1532:5: 
1530.   {
1531.       ENCODE_DATA *expected = t->data;
1532. >     unsigned char *encode_out = NULL, *decode_out = NULL;
1533.       int output_len, chunk_len;
1534.       EVP_ENCODE_CTX *decode_ctx;

test/evp_test.c:1536:10: 
1534.       EVP_ENCODE_CTX *decode_ctx;
1535.   
1536. >     if (!TEST_ptr(decode_ctx = EVP_ENCODE_CTX_new())) {
1537.           t->err = "INTERNAL_ERROR";
1538.           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:197:1: start of procedure CRYPTO_zalloc()
    195.   }
    196.   
    197. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    198.   {
    199.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:199:5: 
    197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    198.   {
    199. >     void *ret = CRYPTO_malloc(num, file, line);
    200.   
    201.       FAILTEST();

crypto/mem.c:169:1: start of procedure CRYPTO_malloc()
      167.   #endif
      168.   
      169. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      170.   {
      171.       void *ret = NULL;

crypto/mem.c:171:5: 
      169.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      170.   {
      171. >     void *ret = NULL;
      172.   
      173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:173:9: Taking false branch
      171.       void *ret = NULL;
      172.   
      173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      174.           return malloc_impl(num, file, line);
      175.   

crypto/mem.c:176:9: Taking false branch
      174.           return malloc_impl(num, file, line);
      175.   
      176.       if (num == 0)
                     ^
      177.           return NULL;
      178.   

crypto/mem.c:180:5: 
      178.   
      179.       FAILTEST();
      180. >     allow_customize = 0;
      181.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      182.       if (call_malloc_debug) {

crypto/mem.c:190:5: 
      188.       }
      189.   #else
      190. >     osslargused(file); osslargused(line);
      191.       ret = malloc(num);
      192.   #endif

crypto/mem.c:190:24: 
      188.       }
      189.   #else
      190. >     osslargused(file); osslargused(line);
      191.       ret = malloc(num);
      192.   #endif

crypto/mem.c:191:5: 
      189.   #else
      190.       osslargused(file); osslargused(line);
      191. >     ret = malloc(num);
      192.   #endif
      193.   

crypto/mem.c:194:5: 
      192.   #endif
      193.   
      194. >     return ret;
      195.   }
      196.   

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

crypto/mem.c:202:9: Taking true branch
    200.   
    201.       FAILTEST();
    202.       if (ret != NULL)
                   ^
    203.           memset(ret, 0, num);
    204.       return ret;

crypto/mem.c:203:9: 
    201.       FAILTEST();
    202.       if (ret != NULL)
    203. >         memset(ret, 0, num);
    204.       return ret;
    205.   }

crypto/mem.c:204:5: 
    202.       if (ret != NULL)
    203.           memset(ret, 0, num);
    204. >     return ret;
    205.   }
    206.   

crypto/mem.c:205:1: return from a call to CRYPTO_zalloc
    203.           memset(ret, 0, num);
    204.       return ret;
    205. > }
    206.   
    207.   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:227:1: start of procedure test_ptr()
  225.   }
  226.   
  227. > int test_ptr(const char *file, int line, const char *s, const void *p)
  228.   {
  229.       if (p != NULL)

test/testutil/tests.c:229:9: Taking true branch
  227.   int test_ptr(const char *file, int line, const char *s, const void *p)
  228.   {
  229.       if (p != NULL)
                 ^
  230.           return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:230:9: 
  228.   {
  229.       if (p != NULL)
  230. >         return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  232.       return 0;

test/testutil/tests.c:233:1: return from a call to test_ptr
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  232.       return 0;
  233. > }
  234.   
  235.   int test_true(const char *file, int line, const char *s, int b)

test/evp_test.c:1536:10: Taking false branch
1534.       EVP_ENCODE_CTX *decode_ctx;
1535.   
1536.       if (!TEST_ptr(decode_ctx = EVP_ENCODE_CTX_new())) {
                 ^
1537.           t->err = "INTERNAL_ERROR";
1538.           goto err;

test/evp_test.c:1541:9: Taking true branch
1539.       }
1540.   
1541.       if (expected->encoding == BASE64_CANONICAL_ENCODING) {
                ^
1542.           EVP_ENCODE_CTX *encode_ctx;
1543.   

test/evp_test.c:1544:14: 
1542.           EVP_ENCODE_CTX *encode_ctx;
1543.   
1544. >         if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
1545.                   || !TEST_ptr(encode_out =
1546.                           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:197:1: start of procedure CRYPTO_zalloc()
    195.   }
    196.   
    197. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    198.   {
    199.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:199:5: 
    197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    198.   {
    199. >     void *ret = CRYPTO_malloc(num, file, line);
    200.   
    201.       FAILTEST();

crypto/mem.c:169:1: start of procedure CRYPTO_malloc()
      167.   #endif
      168.   
      169. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      170.   {
      171.       void *ret = NULL;

crypto/mem.c:171:5: 
      169.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      170.   {
      171. >     void *ret = NULL;
      172.   
      173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:173:9: Taking false branch
      171.       void *ret = NULL;
      172.   
      173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      174.           return malloc_impl(num, file, line);
      175.   

crypto/mem.c:176:9: Taking false branch
      174.           return malloc_impl(num, file, line);
      175.   
      176.       if (num == 0)
                     ^
      177.           return NULL;
      178.   

crypto/mem.c:180:5: 
      178.   
      179.       FAILTEST();
      180. >     allow_customize = 0;
      181.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      182.       if (call_malloc_debug) {

crypto/mem.c:190:5: 
      188.       }
      189.   #else
      190. >     osslargused(file); osslargused(line);
      191.       ret = malloc(num);
      192.   #endif

crypto/mem.c:190:24: 
      188.       }
      189.   #else
      190. >     osslargused(file); osslargused(line);
      191.       ret = malloc(num);
      192.   #endif

crypto/mem.c:191:5: 
      189.   #else
      190.       osslargused(file); osslargused(line);
      191. >     ret = malloc(num);
      192.   #endif
      193.   

crypto/mem.c:194:5: 
      192.   #endif
      193.   
      194. >     return ret;
      195.   }
      196.   

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

crypto/mem.c:202:9: Taking true branch
    200.   
    201.       FAILTEST();
    202.       if (ret != NULL)
                   ^
    203.           memset(ret, 0, num);
    204.       return ret;

crypto/mem.c:203:9: 
    201.       FAILTEST();
    202.       if (ret != NULL)
    203. >         memset(ret, 0, num);
    204.       return ret;
    205.   }

crypto/mem.c:204:5: 
    202.       if (ret != NULL)
    203.           memset(ret, 0, num);
    204. >     return ret;
    205.   }
    206.   

crypto/mem.c:205:1: return from a call to CRYPTO_zalloc
    203.           memset(ret, 0, num);
    204.       return ret;
    205. > }
    206.   
    207.   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:227:1: start of procedure test_ptr()
  225.   }
  226.   
  227. > int test_ptr(const char *file, int line, const char *s, const void *p)
  228.   {
  229.       if (p != NULL)

test/testutil/tests.c:229:9: Taking true branch
  227.   int test_ptr(const char *file, int line, const char *s, const void *p)
  228.   {
  229.       if (p != NULL)
                 ^
  230.           return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:230:9: 
  228.   {
  229.       if (p != NULL)
  230. >         return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  232.       return 0;

test/testutil/tests.c:233:1: return from a call to test_ptr
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  232.       return 0;
  233. > }
  234.   
  235.   int test_true(const char *file, int line, const char *s, int b)

test/evp_test.c:1544:14: Taking false branch
1542.           EVP_ENCODE_CTX *encode_ctx;
1543.   
1544.           if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
                     ^
1545.                   || !TEST_ptr(encode_out =
1546.                           OPENSSL_malloc(EVP_ENCODE_LENGTH(expected->input_len))))

test/evp_test.c:1545:21: 
1543.   
1544.           if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
1545. >                 || !TEST_ptr(encode_out =
1546.                           OPENSSL_malloc(EVP_ENCODE_LENGTH(expected->input_len))))
1547.               goto err;

crypto/mem.c:169:1: start of procedure CRYPTO_malloc()
  167.   #endif
  168.   
  169. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  170.   {
  171.       void *ret = NULL;

crypto/mem.c:171:5: 
  169.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  170.   {
  171. >     void *ret = NULL;
  172.   
  173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:173:9: Taking true branch
  171.       void *ret = NULL;
  172.   
  173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  174.           return malloc_impl(num, file, line);
  175.   

crypto/mem.c:173:32: Taking true branch
  171.       void *ret = NULL;
  172.   
  173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                        ^
  174.           return malloc_impl(num, file, line);
  175.   

crypto/mem.c:174:9: Skipping __function_pointer__(): unresolved function pointer
  172.   
  173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
  174.           return malloc_impl(num, file, line);
                 ^
  175.   
  176.       if (num == 0)

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

test/testutil/tests.c:227:1: start of procedure test_ptr()
  225.   }
  226.   
  227. > int test_ptr(const char *file, int line, const char *s, const void *p)
  228.   {
  229.       if (p != NULL)

test/testutil/tests.c:229:9: Taking false branch
  227.   int test_ptr(const char *file, int line, const char *s, const void *p)
  228.   {
  229.       if (p != NULL)
                 ^
  230.           return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:231:5: Skipping test_fail_message(): empty list of specs
  229.       if (p != NULL)
  230.           return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
             ^
  232.       return 0;
  233.   }

test/testutil/tests.c:232:5: 
  230.           return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  232. >     return 0;
  233.   }
  234.   

test/testutil/tests.c:233:1: return from a call to test_ptr
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  232.       return 0;
  233. > }
  234.   
  235.   int test_true(const char *file, int line, const char *s, int b)

test/evp_test.c:1545:21: Taking true branch
1543.   
1544.           if (!TEST_ptr(encode_ctx = EVP_ENCODE_CTX_new())
1545.                   || !TEST_ptr(encode_out =
                            ^
1546.                           OPENSSL_malloc(EVP_ENCODE_LENGTH(expected->input_len))))
1547.               goto err;
