test/evp_test.c:1541: error: MEMORY_LEAK
  memory dynamically allocated to `return` by call to `CRYPTO_zalloc()` at line 1532, column 10 is not reachable after line 1541, column 13.
Showing all 48 steps of the trace


test/evp_test.c:1528:1: start of procedure encode_test_init()
1526.   } ENCODE_DATA;
1527.   
1528. > static int encode_test_init(EVP_TEST *t, const char *encoding)
1529.   {
1530.       ENCODE_DATA *edata;

test/evp_test.c:1532:10: 
1530.       ENCODE_DATA *edata;
1531.   
1532. >     if (!TEST_ptr(edata = OPENSSL_zalloc(sizeof(*edata))))
1533.           return 0;
1534.       if (strcmp(encoding, "canonical") == 0) {

crypto/mem.c:228:1: start of procedure CRYPTO_zalloc()
  226.   }
  227.   
  228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  229.   {
  230.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:230:5: 
  228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  229.   {
  230. >     void *ret = CRYPTO_malloc(num, file, line);
  231.   
  232.       FAILTEST();

crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
    190.   #endif
    191.   
    192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    193.   {
    194.       void *ret = NULL;

crypto/mem.c:194:5: 
    192.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    193.   {
    194. >     void *ret = NULL;
    195.   
    196.       INCREMENT(malloc_count);

crypto/mem.c:197:9: Taking false branch
    195.   
    196.       INCREMENT(malloc_count);
    197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    198.           return malloc_impl(num, file, line);
    199.   

crypto/mem.c:200:9: Taking false branch
    198.           return malloc_impl(num, file, line);
    199.   
    200.       if (num == 0)
                   ^
    201.           return NULL;
    202.   

crypto/mem.c:204:9: Taking true branch
    202.   
    203.       FAILTEST();
    204.       if (allow_customize) {
                   ^
    205.           /*
    206.            * Disallow customization after the first allocation. We only set this

crypto/mem.c:210:9: 
    208.            * allocation.
    209.            */
    210. >         allow_customize = 0;
    211.       }
    212.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:221:5: 
    219.       }
    220.   #else
    221. >     (void)(file); (void)(line);
    222.       ret = malloc(num);
    223.   #endif

crypto/mem.c:221:19: 
    219.       }
    220.   #else
    221. >     (void)(file); (void)(line);
    222.       ret = malloc(num);
    223.   #endif

crypto/mem.c:222:5: 
    220.   #else
    221.       (void)(file); (void)(line);
    222. >     ret = malloc(num);
    223.   #endif
    224.   

crypto/mem.c:225:5: 
    223.   #endif
    224.   
    225. >     return ret;
    226.   }
    227.   

crypto/mem.c:226:1: return from a call to CRYPTO_malloc
    224.   
    225.       return ret;
    226. > }
    227.   
    228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:233:9: Taking true branch
  231.   
  232.       FAILTEST();
  233.       if (ret != NULL)
                 ^
  234.           memset(ret, 0, num);
  235.       return ret;

crypto/mem.c:234:9: 
  232.       FAILTEST();
  233.       if (ret != NULL)
  234. >         memset(ret, 0, num);
  235.       return ret;
  236.   }

crypto/mem.c:235:5: 
  233.       if (ret != NULL)
  234.           memset(ret, 0, num);
  235. >     return ret;
  236.   }
  237.   

crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
  234.           memset(ret, 0, num);
  235.       return ret;
  236. > }
  237.   
  238.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

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

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

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

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

test/evp_test.c:1532:10: Taking false branch
1530.       ENCODE_DATA *edata;
1531.   
1532.       if (!TEST_ptr(edata = OPENSSL_zalloc(sizeof(*edata))))
                 ^
1533.           return 0;
1534.       if (strcmp(encoding, "canonical") == 0) {

test/evp_test.c:1534:9: Taking false branch
1532.       if (!TEST_ptr(edata = OPENSSL_zalloc(sizeof(*edata))))
1533.           return 0;
1534.       if (strcmp(encoding, "canonical") == 0) {
                ^
1535.           edata->encoding = BASE64_CANONICAL_ENCODING;
1536.       } else if (strcmp(encoding, "valid") == 0) {

test/evp_test.c:1536:16: Taking false branch
1534.       if (strcmp(encoding, "canonical") == 0) {
1535.           edata->encoding = BASE64_CANONICAL_ENCODING;
1536.       } else if (strcmp(encoding, "valid") == 0) {
                       ^
1537.           edata->encoding = BASE64_VALID_ENCODING;
1538.       } else if (strcmp(encoding, "invalid") == 0) {

test/evp_test.c:1538:16: Taking true branch
1536.       } else if (strcmp(encoding, "valid") == 0) {
1537.           edata->encoding = BASE64_VALID_ENCODING;
1538.       } else if (strcmp(encoding, "invalid") == 0) {
                       ^
1539.           edata->encoding = BASE64_INVALID_ENCODING;
1540.           if (!TEST_ptr(t->expected_err = OPENSSL_strdup("DECODE_ERROR")))

test/evp_test.c:1539:9: 
1537.           edata->encoding = BASE64_VALID_ENCODING;
1538.       } else if (strcmp(encoding, "invalid") == 0) {
1539. >         edata->encoding = BASE64_INVALID_ENCODING;
1540.           if (!TEST_ptr(t->expected_err = OPENSSL_strdup("DECODE_ERROR")))
1541.               return 0;

test/evp_test.c:1540:14: 
1538.       } else if (strcmp(encoding, "invalid") == 0) {
1539.           edata->encoding = BASE64_INVALID_ENCODING;
1540. >         if (!TEST_ptr(t->expected_err = OPENSSL_strdup("DECODE_ERROR")))
1541.               return 0;
1542.       } else {

crypto/o_str.c:27:1: start of procedure CRYPTO_strdup()
  25.   }
  26.   
  27. > char *CRYPTO_strdup(const char *str, const char* file, int line)
  28.   {
  29.       char *ret;

crypto/o_str.c:31:9: Taking false branch
  29.       char *ret;
  30.   
  31.       if (str == NULL)
                ^
  32.           return NULL;
  33.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);

crypto/o_str.c:33:5: 
  31.       if (str == NULL)
  32.           return NULL;
  33. >     ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  34.       if (ret != NULL)
  35.           strcpy(ret, str);

crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
    190.   #endif
    191.   
    192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    193.   {
    194.       void *ret = NULL;

crypto/mem.c:194:5: 
    192.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    193.   {
    194. >     void *ret = NULL;
    195.   
    196.       INCREMENT(malloc_count);

crypto/mem.c:197:9: Taking true branch
    195.   
    196.       INCREMENT(malloc_count);
    197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    198.           return malloc_impl(num, file, line);
    199.   

crypto/mem.c:197:32: Taking true branch
    195.   
    196.       INCREMENT(malloc_count);
    197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                          ^
    198.           return malloc_impl(num, file, line);
    199.   

crypto/mem.c:198:9: Skipping __function_pointer__(): unresolved function pointer
    196.       INCREMENT(malloc_count);
    197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
    198.           return malloc_impl(num, file, line);
                   ^
    199.   
    200.       if (num == 0)

crypto/mem.c:226:1: return from a call to CRYPTO_malloc
    224.   
    225.       return ret;
    226. > }
    227.   
    228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/o_str.c:34:9: Taking false branch
  32.           return NULL;
  33.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  34.       if (ret != NULL)
                ^
  35.           strcpy(ret, str);
  36.       return ret;

crypto/o_str.c:36:5: 
  34.       if (ret != NULL)
  35.           strcpy(ret, str);
  36. >     return ret;
  37.   }
  38.   

crypto/o_str.c:37:1: return from a call to CRYPTO_strdup
  35.           strcpy(ret, str);
  36.       return ret;
  37. > }
  38.   
  39.   char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)

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

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

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

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

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

test/evp_test.c:1540:14: Taking true branch
1538.       } else if (strcmp(encoding, "invalid") == 0) {
1539.           edata->encoding = BASE64_INVALID_ENCODING;
1540.           if (!TEST_ptr(t->expected_err = OPENSSL_strdup("DECODE_ERROR")))
                     ^
1541.               return 0;
1542.       } else {

test/evp_test.c:1541:13: 
1539.           edata->encoding = BASE64_INVALID_ENCODING;
1540.           if (!TEST_ptr(t->expected_err = OPENSSL_strdup("DECODE_ERROR")))
1541. >             return 0;
1542.       } else {
1543.           TEST_error("Bad encoding: %s."
