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


test/evp_test.c:1750:1: start of procedure encode_test_init()
1748.   };
1749.   
1750. > static int encode_test_init(struct evp_test *t, const char *encoding)
1751.   {
1752.       struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));

test/evp_test.c:1752:5: 
1750.   static int encode_test_init(struct evp_test *t, const char *encoding)
1751.   {
1752. >     struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
1753.   
1754.       if (strcmp(encoding, "canonical") == 0) {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

test/evp_test.c:1754:9: Taking false branch
1752.       struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
1753.   
1754.       if (strcmp(encoding, "canonical") == 0) {
                ^
1755.           edata->encoding = BASE64_CANONICAL_ENCODING;
1756.       } else if (strcmp(encoding, "valid") == 0) {

test/evp_test.c:1756:16: Taking false branch
1754.       if (strcmp(encoding, "canonical") == 0) {
1755.           edata->encoding = BASE64_CANONICAL_ENCODING;
1756.       } else if (strcmp(encoding, "valid") == 0) {
                       ^
1757.           edata->encoding = BASE64_VALID_ENCODING;
1758.       } else if (strcmp(encoding, "invalid") == 0) {

test/evp_test.c:1758:16: Taking true branch
1756.       } else if (strcmp(encoding, "valid") == 0) {
1757.           edata->encoding = BASE64_VALID_ENCODING;
1758.       } else if (strcmp(encoding, "invalid") == 0) {
                       ^
1759.           edata->encoding = BASE64_INVALID_ENCODING;
1760.           t->expected_err = OPENSSL_strdup("DECODE_ERROR");

test/evp_test.c:1759:9: 
1757.           edata->encoding = BASE64_VALID_ENCODING;
1758.       } else if (strcmp(encoding, "invalid") == 0) {
1759. >         edata->encoding = BASE64_INVALID_ENCODING;
1760.           t->expected_err = OPENSSL_strdup("DECODE_ERROR");
1761.           if (t->expected_err == NULL)

test/evp_test.c:1760:9: 
1758.       } else if (strcmp(encoding, "invalid") == 0) {
1759.           edata->encoding = BASE64_INVALID_ENCODING;
1760. >         t->expected_err = OPENSSL_strdup("DECODE_ERROR");
1761.           if (t->expected_err == NULL)
1762.               return 0;

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

crypto/o_str.c:33:9: Taking false branch
  31.       size_t size;
  32.   
  33.       if (str == NULL)
                ^
  34.           return NULL;
  35.       size = strlen(str) + 1;

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

crypto/o_str.c:36:5: 
  34.           return NULL;
  35.       size = strlen(str) + 1;
  36. >     ret = CRYPTO_malloc(size, file, line);
  37.       if (ret != NULL)
  38.           memcpy(ret, str, size);

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

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

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

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

crypto/mem.c:165:9: 
    163.   
    164.       if (num <= 0)
    165. >         return NULL;
    166.   
    167.       FAILTEST();

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

crypto/o_str.c:37:9: Taking false branch
  35.       size = strlen(str) + 1;
  36.       ret = CRYPTO_malloc(size, file, line);
  37.       if (ret != NULL)
                ^
  38.           memcpy(ret, str, size);
  39.       return ret;

crypto/o_str.c:39:5: 
  37.       if (ret != NULL)
  38.           memcpy(ret, str, size);
  39. >     return ret;
  40.   }
  41.   

crypto/o_str.c:40:1: return from a call to CRYPTO_strdup
  38.           memcpy(ret, str, size);
  39.       return ret;
  40. > }
  41.   
  42.   char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)

test/evp_test.c:1761:13: Taking true branch
1759.           edata->encoding = BASE64_INVALID_ENCODING;
1760.           t->expected_err = OPENSSL_strdup("DECODE_ERROR");
1761.           if (t->expected_err == NULL)
                    ^
1762.               return 0;
1763.       } else {

test/evp_test.c:1762:13: 
1760.           t->expected_err = OPENSSL_strdup("DECODE_ERROR");
1761.           if (t->expected_err == NULL)
1762. >             return 0;
1763.       } else {
1764.           fprintf(stderr, "Bad encoding: %s. Should be one of "
