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


test/evp_test.c:1723:1: start of procedure encode_test_init()
1721.   };
1722.   
1723. > static int encode_test_init(struct evp_test *t, const char *encoding)
1724.   {
1725.       struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));

test/evp_test.c:1725:5: 
1723.   static int encode_test_init(struct evp_test *t, const char *encoding)
1724.   {
1725. >     struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
1726.   
1727.       if (strcmp(encoding, "canonical") == 0) {

crypto/mem.c:98:1: start of procedure CRYPTO_zalloc()
  96.   }
  97.   
  98. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  99.   {
  100.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:100:5: 
  98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  99.   {
  100. >     void *ret = CRYPTO_malloc(num, file, line);
  101.   
  102.       if (ret != NULL)

crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
    69.   }
    70.   
    71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73.       void *ret = NULL;

crypto/mem.c:73:5: 
    71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73. >     void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
    73.       void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                  ^
    76.           return malloc_impl(num, file, line);
    77.   

crypto/mem.c:78:9: Taking false branch
    76.           return malloc_impl(num, file, line);
    77.   
    78.       if (num <= 0)
                  ^
    79.           return NULL;
    80.   

crypto/mem.c:81:5: 
    79.           return NULL;
    80.   
    81. >     allow_customize = 0;
    82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
    89.       }
    90.   #else
    91. >     osslargused(file); osslargused(line);
    92.       ret = malloc(num);
    93.   #endif

crypto/mem.c:91:24: 
    89.       }
    90.   #else
    91. >     osslargused(file); osslargused(line);
    92.       ret = malloc(num);
    93.   #endif

crypto/mem.c:92:5: 
    90.   #else
    91.       osslargused(file); osslargused(line);
    92. >     ret = malloc(num);
    93.   #endif
    94.   

crypto/mem.c:95:5: 
    93.   #endif
    94.   
    95. >     return ret;
    96.   }
    97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
    94.   
    95.       return ret;
    96. > }
    97.   
    98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:102:9: Taking true branch
  100.       void *ret = CRYPTO_malloc(num, file, line);
  101.   
  102.       if (ret != NULL)
                 ^
  103.           memset(ret, 0, num);
  104.       return ret;

crypto/mem.c:103:9: 
  101.   
  102.       if (ret != NULL)
  103. >         memset(ret, 0, num);
  104.       return ret;
  105.   }

crypto/mem.c:104:5: 
  102.       if (ret != NULL)
  103.           memset(ret, 0, num);
  104. >     return ret;
  105.   }
  106.   

crypto/mem.c:105:1: return from a call to CRYPTO_zalloc
  103.           memset(ret, 0, num);
  104.       return ret;
  105. > }
  106.   
  107.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

test/evp_test.c:1727:9: Taking false branch
1725.       struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
1726.   
1727.       if (strcmp(encoding, "canonical") == 0) {
                ^
1728.           edata->encoding = BASE64_CANONICAL_ENCODING;
1729.       } else if (strcmp(encoding, "valid") == 0) {

test/evp_test.c:1729:16: Taking false branch
1727.       if (strcmp(encoding, "canonical") == 0) {
1728.           edata->encoding = BASE64_CANONICAL_ENCODING;
1729.       } else if (strcmp(encoding, "valid") == 0) {
                       ^
1730.           edata->encoding = BASE64_VALID_ENCODING;
1731.       } else if (strcmp(encoding, "invalid") == 0) {

test/evp_test.c:1731:16: Taking true branch
1729.       } else if (strcmp(encoding, "valid") == 0) {
1730.           edata->encoding = BASE64_VALID_ENCODING;
1731.       } else if (strcmp(encoding, "invalid") == 0) {
                       ^
1732.           edata->encoding = BASE64_INVALID_ENCODING;
1733.           t->expected_err = OPENSSL_strdup("DECODE_ERROR");

test/evp_test.c:1732:9: 
1730.           edata->encoding = BASE64_VALID_ENCODING;
1731.       } else if (strcmp(encoding, "invalid") == 0) {
1732. >         edata->encoding = BASE64_INVALID_ENCODING;
1733.           t->expected_err = OPENSSL_strdup("DECODE_ERROR");
1734.           if (t->expected_err == NULL)

test/evp_test.c:1733:9: 
1731.       } else if (strcmp(encoding, "invalid") == 0) {
1732.           edata->encoding = BASE64_INVALID_ENCODING;
1733. >         t->expected_err = OPENSSL_strdup("DECODE_ERROR");
1734.           if (t->expected_err == NULL)
1735.               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:71:1: start of procedure CRYPTO_malloc()
    69.   }
    70.   
    71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73.       void *ret = NULL;

crypto/mem.c:73:5: 
    71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73. >     void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
    73.       void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                  ^
    76.           return malloc_impl(num, file, line);
    77.   

crypto/mem.c:78:9: Taking true branch
    76.           return malloc_impl(num, file, line);
    77.   
    78.       if (num <= 0)
                  ^
    79.           return NULL;
    80.   

crypto/mem.c:79:9: 
    77.   
    78.       if (num <= 0)
    79. >         return NULL;
    80.   
    81.       allow_customize = 0;

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
    94.   
    95.       return ret;
    96. > }
    97.   
    98.   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:1734:13: Taking true branch
1732.           edata->encoding = BASE64_INVALID_ENCODING;
1733.           t->expected_err = OPENSSL_strdup("DECODE_ERROR");
1734.           if (t->expected_err == NULL)
                    ^
1735.               return 0;
1736.       } else {

test/evp_test.c:1735:13: 
1733.           t->expected_err = OPENSSL_strdup("DECODE_ERROR");
1734.           if (t->expected_err == NULL)
1735. >             return 0;
1736.       } else {
1737.           fprintf(stderr, "Bad encoding: %s. Should be one of "
