crypto/x509/x509_cmp.c:267: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 251, column 26 is not reachable after line 267, column 5.
Showing all 58 steps of the trace


crypto/x509/x509_cmp.c:249:1: start of procedure X509_NAME_hash_old()
247.    */
248.   
249. > unsigned long X509_NAME_hash_old(X509_NAME *x)
250.   {
251.       EVP_MD_CTX *md_ctx = EVP_MD_CTX_new();

crypto/x509/x509_cmp.c:251:5: 
249.   unsigned long X509_NAME_hash_old(X509_NAME *x)
250.   {
251. >     EVP_MD_CTX *md_ctx = EVP_MD_CTX_new();
252.       unsigned long ret = 0;
253.       unsigned char md[16];

crypto/evp/digest.c:152:1: start of procedure EVP_MD_CTX_new()
  150.   }
  151.   
  152. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:154:5: 
  152.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155.   }
  156.   

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

crypto/mem.c:161:5: 
    159.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    160.   {
    161. >     void *ret = CRYPTO_malloc(num, file, line);
    162.   
    163.       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 (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      124.           return malloc_impl(num, file, line);
      125.   

crypto/mem.c:126:9: Taking false branch
      124.           return malloc_impl(num, file, line);
      125.   
      126.       if (num <= 0)
                     ^
      127.           return NULL;
      128.   

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

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

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

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

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

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

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

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

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

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

crypto/evp/digest.c:155:1: return from a call to EVP_MD_CTX_new
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155. > }
  156.   
  157.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

crypto/x509/x509_cmp.c:252:5: 
250.   {
251.       EVP_MD_CTX *md_ctx = EVP_MD_CTX_new();
252. >     unsigned long ret = 0;
253.       unsigned char md[16];
254.   

crypto/x509/x509_cmp.c:255:9: Taking false branch
253.       unsigned char md[16];
254.   
255.       if (md_ctx == NULL)
               ^
256.           return ret;
257.   

crypto/x509/x509_cmp.c:259:5: 
257.   
258.       /* Make sure X509_NAME structure contains valid cached encoding */
259. >     i2d_X509_NAME(x, NULL);
260.       EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
261.       if (EVP_DigestInit_ex(md_ctx, EVP_md5(), NULL)

crypto/x509/x_name.c:127:1: start of procedure i2d_X509_NAME()
  125.   IMPLEMENT_EXTERN_ASN1(X509_NAME, V_ASN1_SEQUENCE, x509_name_ff)
  126.   
  127. > IMPLEMENT_ASN1_FUNCTIONS(X509_NAME)
  128.   
  129.   IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME)

crypto/asn1/tasn_enc.c:91:1: start of procedure ASN1_item_i2d()
    89.   }
    90.   
    91. > int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it)
    92.   {
    93.       return asn1_item_flags_i2d(val, out, it, 0);

crypto/asn1/tasn_enc.c:93:5: 
    91.   int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it)
    92.   {
    93. >     return asn1_item_flags_i2d(val, out, it, 0);
    94.   }
    95.   

crypto/asn1/tasn_enc.c:103:1: start of procedure asn1_item_flags_i2d()
      101.    */
      102.   
      103. > static int asn1_item_flags_i2d(ASN1_VALUE *val, unsigned char **out,
      104.                                  const ASN1_ITEM *it, int flags)
      105.   {

crypto/asn1/tasn_enc.c:106:9: Taking false branch
      104.                                  const ASN1_ITEM *it, int flags)
      105.   {
      106.       if (out && !*out) {
                     ^
      107.           unsigned char *p, *buf;
      108.           int len;

crypto/asn1/tasn_enc.c:121:5: Skipping ASN1_item_ex_i2d(): empty list of specs
      119.       }
      120.   
      121.       return ASN1_item_ex_i2d(&val, out, it, -1, flags);
                 ^
      122.   }
      123.   

crypto/asn1/tasn_enc.c:122:1: return from a call to asn1_item_flags_i2d
      120.   
      121.       return ASN1_item_ex_i2d(&val, out, it, -1, flags);
      122. > }
      123.   
      124.   /*

crypto/asn1/tasn_enc.c:94:1: return from a call to ASN1_item_i2d
    92.   {
    93.       return asn1_item_flags_i2d(val, out, it, 0);
    94. > }
    95.   
    96.   /*

crypto/x509/x_name.c:127:1: return from a call to i2d_X509_NAME
  125.   IMPLEMENT_EXTERN_ASN1(X509_NAME, V_ASN1_SEQUENCE, x509_name_ff)
  126.   
  127. > IMPLEMENT_ASN1_FUNCTIONS(X509_NAME)
  128.   
  129.   IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME)

crypto/x509/x509_cmp.c:260:5: 
258.       /* Make sure X509_NAME structure contains valid cached encoding */
259.       i2d_X509_NAME(x, NULL);
260. >     EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
261.       if (EVP_DigestInit_ex(md_ctx, EVP_md5(), NULL)
262.           && EVP_DigestUpdate(md_ctx, x->bytes->data, x->bytes->length)

crypto/evp/evp_lib.c:507:1: start of procedure EVP_MD_CTX_set_flags()
  505.   }
  506.   
  507. > void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags)
  508.   {
  509.       ctx->flags |= flags;

crypto/evp/evp_lib.c:509:5: 
  507.   void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags)
  508.   {
  509. >     ctx->flags |= flags;
  510.   }
  511.   

crypto/evp/evp_lib.c:510:1: return from a call to EVP_MD_CTX_set_flags
  508.   {
  509.       ctx->flags |= flags;
  510. > }
  511.   
  512.   void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags)

crypto/x509/x509_cmp.c:261:9: 
259.       i2d_X509_NAME(x, NULL);
260.       EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
261. >     if (EVP_DigestInit_ex(md_ctx, EVP_md5(), NULL)
262.           && EVP_DigestUpdate(md_ctx, x->bytes->data, x->bytes->length)
263.           && EVP_DigestFinal_ex(md_ctx, md, NULL))

crypto/evp/m_md5.c:101:1: start of procedure EVP_md5()
  99.   };
  100.   
  101. > const EVP_MD *EVP_md5(void)
  102.   {
  103.       return (&md5_md);

crypto/evp/m_md5.c:103:5: 
  101.   const EVP_MD *EVP_md5(void)
  102.   {
  103. >     return (&md5_md);
  104.   }
  105.   #endif

crypto/evp/m_md5.c:104:1: return from a call to EVP_md5
  102.   {
  103.       return (&md5_md);
  104. > }
  105.   #endif

crypto/x509/x509_cmp.c:261:9: Taking true branch
259.       i2d_X509_NAME(x, NULL);
260.       EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
261.       if (EVP_DigestInit_ex(md_ctx, EVP_md5(), NULL)
               ^
262.           && EVP_DigestUpdate(md_ctx, x->bytes->data, x->bytes->length)
263.           && EVP_DigestFinal_ex(md_ctx, md, NULL))

crypto/x509/x509_cmp.c:262:12: 
260.       EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
261.       if (EVP_DigestInit_ex(md_ctx, EVP_md5(), NULL)
262. >         && EVP_DigestUpdate(md_ctx, x->bytes->data, x->bytes->length)
263.           && EVP_DigestFinal_ex(md_ctx, md, NULL))
264.           ret = (((unsigned long)md[0]) | ((unsigned long)md[1] << 8L) |

crypto/evp/digest.c:254:1: start of procedure EVP_DigestUpdate()
  252.   }
  253.   
  254. > int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
  255.   {
  256.       return ctx->update(ctx, data, count);

crypto/evp/digest.c:256:5: Skipping __function_pointer__(): unresolved function pointer
  254.   int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
  255.   {
  256.       return ctx->update(ctx, data, count);
             ^
  257.   }
  258.   

crypto/evp/digest.c:257:1: return from a call to EVP_DigestUpdate
  255.   {
  256.       return ctx->update(ctx, data, count);
  257. > }
  258.   
  259.   /* The caller can assume that this removes any secret data from the context */

crypto/x509/x509_cmp.c:262:12: Taking false branch
260.       EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
261.       if (EVP_DigestInit_ex(md_ctx, EVP_md5(), NULL)
262.           && EVP_DigestUpdate(md_ctx, x->bytes->data, x->bytes->length)
                  ^
263.           && EVP_DigestFinal_ex(md_ctx, md, NULL))
264.           ret = (((unsigned long)md[0]) | ((unsigned long)md[1] << 8L) |

crypto/x509/x509_cmp.c:267:5: 
265.                  ((unsigned long)md[2] << 16L) | ((unsigned long)md[3] << 24L)
266.               ) & 0xffffffffL;
267. >     EVP_MD_CTX_free(md_ctx);
268.   
269.       return (ret);

crypto/evp/digest.c:157:1: start of procedure EVP_MD_CTX_free()
  155.   }
  156.   
  157. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  158.   {
  159.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:159:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  157.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  158.   {
  159.       EVP_MD_CTX_reset(ctx);
             ^
  160.       OPENSSL_free(ctx);
  161.   }

crypto/evp/digest.c:160:5: 
  158.   {
  159.       EVP_MD_CTX_reset(ctx);
  160. >     OPENSSL_free(ctx);
  161.   }
  162.   

crypto/mem.c:225:1: start of procedure CRYPTO_free()
    223.   }
    224.   
    225. > void CRYPTO_free(void *str, const char *file, int line)
    226.   {
    227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:227:9: Taking true branch
    225.   void CRYPTO_free(void *str, const char *file, int line)
    226.   {
    227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    228.           free_impl(str, file, line);
    229.           return;

crypto/mem.c:227:30: Taking true branch
    225.   void CRYPTO_free(void *str, const char *file, int line)
    226.   {
    227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    228.           free_impl(str, file, line);
    229.           return;

crypto/mem.c:228:9: Skipping __function_pointer__(): unresolved function pointer
    226.   {
    227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    228.           free_impl(str, file, line);
                   ^
    229.           return;
    230.       }

crypto/mem.c:229:9: 
    227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    228.           free_impl(str, file, line);
    229. >         return;
    230.       }
    231.   

crypto/mem.c:243:1: return from a call to CRYPTO_free
    241.       free(str);
    242.   #endif
    243. > }
    244.   
    245.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:161:1: return from a call to EVP_MD_CTX_free
  159.       EVP_MD_CTX_reset(ctx);
  160.       OPENSSL_free(ctx);
  161. > }
  162.   
  163.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
