test/evp_test.c:1686: error: MEMORY_LEAK
  memory dynamically allocated to `encode_ctx` by call to `EVP_ENCODE_CTX_new()` at line 1682, column 38 is not reachable after line 1686, column 13.
Showing all 56 steps of the trace


test/evp_test.c:1670:1: start of procedure encode_test_run()
1668.   }
1669.   
1670. > static int encode_test_run(struct evp_test *t)
1671.   {
1672.       struct encode_data *edata = t->data;

test/evp_test.c:1672:5: 
1670.   static int encode_test_run(struct evp_test *t)
1671.   {
1672. >     struct encode_data *edata = t->data;
1673.       unsigned char *encode_out = NULL, *decode_out = NULL;
1674.       int output_len, chunk_len;

test/evp_test.c:1673:5: 
1671.   {
1672.       struct encode_data *edata = t->data;
1673. >     unsigned char *encode_out = NULL, *decode_out = NULL;
1674.       int output_len, chunk_len;
1675.       const char *err = "INTERNAL_ERROR";

test/evp_test.c:1675:5: 
1673.       unsigned char *encode_out = NULL, *decode_out = NULL;
1674.       int output_len, chunk_len;
1675. >     const char *err = "INTERNAL_ERROR";
1676.       EVP_ENCODE_CTX *decode_ctx = EVP_ENCODE_CTX_new();
1677.   

test/evp_test.c:1676:5: 
1674.       int output_len, chunk_len;
1675.       const char *err = "INTERNAL_ERROR";
1676. >     EVP_ENCODE_CTX *decode_ctx = EVP_ENCODE_CTX_new();
1677.   
1678.       if (decode_ctx == NULL)

crypto/evp/encode.c:143:1: start of procedure EVP_ENCODE_CTX_new()
  141.   #endif
  142.   
  143. > EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
  144.   {
  145.       return (EVP_ENCODE_CTX *)OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));

crypto/evp/encode.c:145:5: 
  143.   EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
  144.   {
  145. >     return (EVP_ENCODE_CTX *)OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
  146.   }
  147.   

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

crypto/evp/encode.c:146:1: return from a call to EVP_ENCODE_CTX_new
  144.   {
  145.       return (EVP_ENCODE_CTX *)OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
  146. > }
  147.   
  148.   void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)

test/evp_test.c:1678:9: Taking false branch
1676.       EVP_ENCODE_CTX *decode_ctx = EVP_ENCODE_CTX_new();
1677.   
1678.       if (decode_ctx == NULL)
                ^
1679.           goto err;
1680.   

test/evp_test.c:1681:9: Taking true branch
1679.           goto err;
1680.   
1681.       if (edata->encoding == BASE64_CANONICAL_ENCODING) {
                ^
1682.           EVP_ENCODE_CTX *encode_ctx = EVP_ENCODE_CTX_new();
1683.           if (encode_ctx == NULL)

test/evp_test.c:1682:9: 
1680.   
1681.       if (edata->encoding == BASE64_CANONICAL_ENCODING) {
1682. >         EVP_ENCODE_CTX *encode_ctx = EVP_ENCODE_CTX_new();
1683.           if (encode_ctx == NULL)
1684.               goto err;

crypto/evp/encode.c:143:1: start of procedure EVP_ENCODE_CTX_new()
  141.   #endif
  142.   
  143. > EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
  144.   {
  145.       return (EVP_ENCODE_CTX *)OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));

crypto/evp/encode.c:145:5: 
  143.   EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
  144.   {
  145. >     return (EVP_ENCODE_CTX *)OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
  146.   }
  147.   

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

crypto/evp/encode.c:146:1: return from a call to EVP_ENCODE_CTX_new
  144.   {
  145.       return (EVP_ENCODE_CTX *)OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
  146. > }
  147.   
  148.   void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)

test/evp_test.c:1683:13: Taking false branch
1681.       if (edata->encoding == BASE64_CANONICAL_ENCODING) {
1682.           EVP_ENCODE_CTX *encode_ctx = EVP_ENCODE_CTX_new();
1683.           if (encode_ctx == NULL)
                    ^
1684.               goto err;
1685.           encode_out = OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len));

test/evp_test.c:1685:9: 
1683.           if (encode_ctx == NULL)
1684.               goto err;
1685. >         encode_out = OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len));
1686.           if (encode_out == NULL)
1687.               goto err;

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

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

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

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

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

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

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

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

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

test/evp_test.c:1686:13: Taking true branch
1684.               goto err;
1685.           encode_out = OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len));
1686.           if (encode_out == NULL)
                    ^
1687.               goto err;
1688.   
