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


test/evp_test.c:1549:1: start of procedure encode_test_init()
1547.   };
1548.   
1549. > static int encode_test_init(struct evp_test *t, const char *encoding)
1550.   {
1551.       struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));

test/evp_test.c:1551:5: 
1549.   static int encode_test_init(struct evp_test *t, const char *encoding)
1550.   {
1551. >     struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
1552.   
1553.       if (strcmp(encoding, "canonical") == 0) {

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

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

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
    118.   }
    119.   
    120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122.       void *ret = NULL;

crypto/mem.c:122:5: 
    120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122. >     void *ret = NULL;
    123.   
    124.       if (num <= 0)

crypto/mem.c:124:9: Taking false branch
    122.       void *ret = NULL;
    123.   
    124.       if (num <= 0)
                   ^
    125.           return NULL;
    126.   

crypto/mem.c:127:5: 
    125.           return NULL;
    126.   
    127. >     allow_customize = 0;
    128.   #ifdef CRYPTO_MDEBUG
    129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
    135.       }
    136.   #else
    137. >     (void)file;
    138.       (void)line;
    139.       ret = malloc(num);

crypto/mem.c:138:5: 
    136.   #else
    137.       (void)file;
    138. >     (void)line;
    139.       ret = malloc(num);
    140.   #endif

crypto/mem.c:139:5: 
    137.       (void)file;
    138.       (void)line;
    139. >     ret = malloc(num);
    140.   #endif
    141.   

crypto/mem.c:154:5: 
    152.   #endif
    153.   
    154. >     return ret;
    155.   }
    156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
    153.   
    154.       return ret;
    155. > }
    156.   
    157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

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

crypto/mem.c:162:9: 
  160.   
  161.       if (ret != NULL)
  162. >         memset(ret, 0, num);
  163.       return ret;
  164.   }

crypto/mem.c:163:5: 
  161.       if (ret != NULL)
  162.           memset(ret, 0, num);
  163. >     return ret;
  164.   }
  165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
  162.           memset(ret, 0, num);
  163.       return ret;
  164. > }
  165.   
  166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

test/evp_test.c:1553:9: Taking false branch
1551.       struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
1552.   
1553.       if (strcmp(encoding, "canonical") == 0) {
                ^
1554.           edata->encoding = BASE64_CANONICAL_ENCODING;
1555.       } else if (strcmp(encoding, "valid") == 0) {

test/evp_test.c:1555:16: Taking false branch
1553.       if (strcmp(encoding, "canonical") == 0) {
1554.           edata->encoding = BASE64_CANONICAL_ENCODING;
1555.       } else if (strcmp(encoding, "valid") == 0) {
                       ^
1556.           edata->encoding = BASE64_VALID_ENCODING;
1557.       } else if (strcmp(encoding, "invalid") == 0) {

test/evp_test.c:1557:16: Taking true branch
1555.       } else if (strcmp(encoding, "valid") == 0) {
1556.           edata->encoding = BASE64_VALID_ENCODING;
1557.       } else if (strcmp(encoding, "invalid") == 0) {
                       ^
1558.           edata->encoding = BASE64_INVALID_ENCODING;
1559.           t->expected_err = OPENSSL_strdup("DECODE_ERROR");

test/evp_test.c:1558:9: 
1556.           edata->encoding = BASE64_VALID_ENCODING;
1557.       } else if (strcmp(encoding, "invalid") == 0) {
1558. >         edata->encoding = BASE64_INVALID_ENCODING;
1559.           t->expected_err = OPENSSL_strdup("DECODE_ERROR");
1560.           if (t->expected_err == NULL)

test/evp_test.c:1559:9: 
1557.       } else if (strcmp(encoding, "invalid") == 0) {
1558.           edata->encoding = BASE64_INVALID_ENCODING;
1559. >         t->expected_err = OPENSSL_strdup("DECODE_ERROR");
1560.           if (t->expected_err == NULL)
1561.               return 0;

crypto/o_str.c:121:1: start of procedure CRYPTO_strdup()
  119.   }
  120.   
  121. > char *CRYPTO_strdup(const char *str, const char* file, int line)
  122.   {
  123.       char *ret;

crypto/o_str.c:125:9: Taking false branch
  123.       char *ret;
  124.   
  125.       if (str == NULL)
                 ^
  126.           return NULL;
  127.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);

crypto/o_str.c:127:5: 
  125.       if (str == NULL)
  126.           return NULL;
  127. >     ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  128.       if (ret != NULL)
  129.           strcpy(ret, str);

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
    118.   }
    119.   
    120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122.       void *ret = NULL;

crypto/mem.c:122:5: 
    120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122. >     void *ret = NULL;
    123.   
    124.       if (num <= 0)

crypto/mem.c:124:9: Taking false branch
    122.       void *ret = NULL;
    123.   
    124.       if (num <= 0)
                   ^
    125.           return NULL;
    126.   

crypto/mem.c:127:5: 
    125.           return NULL;
    126.   
    127. >     allow_customize = 0;
    128.   #ifdef CRYPTO_MDEBUG
    129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
    135.       }
    136.   #else
    137. >     (void)file;
    138.       (void)line;
    139.       ret = malloc(num);

crypto/mem.c:138:5: 
    136.   #else
    137.       (void)file;
    138. >     (void)line;
    139.       ret = malloc(num);
    140.   #endif

crypto/mem.c:139:5: 
    137.       (void)file;
    138.       (void)line;
    139. >     ret = malloc(num);
    140.   #endif
    141.   

crypto/mem.c:154:5: 
    152.   #endif
    153.   
    154. >     return ret;
    155.   }
    156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
    153.   
    154.       return ret;
    155. > }
    156.   
    157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/o_str.c:128:9: Taking false branch
  126.           return NULL;
  127.       ret = CRYPTO_malloc(strlen(str) + 1, file, line);
  128.       if (ret != NULL)
                 ^
  129.           strcpy(ret, str);
  130.       return ret;

crypto/o_str.c:130:5: 
  128.       if (ret != NULL)
  129.           strcpy(ret, str);
  130. >     return ret;
  131.   }
  132.   

crypto/o_str.c:131:1: return from a call to CRYPTO_strdup
  129.           strcpy(ret, str);
  130.       return ret;
  131. > }
  132.   
  133.   char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)

test/evp_test.c:1560:13: Taking true branch
1558.           edata->encoding = BASE64_INVALID_ENCODING;
1559.           t->expected_err = OPENSSL_strdup("DECODE_ERROR");
1560.           if (t->expected_err == NULL)
                    ^
1561.               return 0;
1562.       } else {

test/evp_test.c:1561:13: 
1559.           t->expected_err = OPENSSL_strdup("DECODE_ERROR");
1560.           if (t->expected_err == NULL)
1561. >             return 0;
1562.       } else {
1563.           fprintf(stderr, "Bad encoding: %s. Should be one of "
