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


crypto/x509/x509_cmp.c:207:1: start of procedure X509_NAME_hash_old()
205.    */
206.   
207. > unsigned long X509_NAME_hash_old(X509_NAME *x)
208.   {
209.       EVP_MD_CTX *md_ctx = EVP_MD_CTX_new();

crypto/x509/x509_cmp.c:209:5: 
207.   unsigned long X509_NAME_hash_old(X509_NAME *x)
208.   {
209. >     EVP_MD_CTX *md_ctx = EVP_MD_CTX_new();
210.       unsigned long ret = 0;
211.       unsigned char md[16];

crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new()
  42.   }
  43.   
  44. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:46:5: 
  44.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47.   }
  48.   

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)

crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47. > }
  48.   
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

crypto/x509/x509_cmp.c:210:5: 
208.   {
209.       EVP_MD_CTX *md_ctx = EVP_MD_CTX_new();
210. >     unsigned long ret = 0;
211.       unsigned char md[16];
212.   

crypto/x509/x509_cmp.c:213:9: Taking false branch
211.       unsigned char md[16];
212.   
213.       if (md_ctx == NULL)
               ^
214.           return ret;
215.   

crypto/x509/x509_cmp.c:217:5: 
215.   
216.       /* Make sure X509_NAME structure contains valid cached encoding */
217. >     i2d_X509_NAME(x, NULL);
218.       EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
219.       if (EVP_DigestInit_ex(md_ctx, EVP_md5(), NULL)

crypto/x509/x_name.c:86:1: start of procedure i2d_X509_NAME()
  84.   IMPLEMENT_EXTERN_ASN1(X509_NAME, V_ASN1_SEQUENCE, x509_name_ff)
  85.   
  86. > IMPLEMENT_ASN1_FUNCTIONS(X509_NAME)
  87.   
  88.   IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME)

crypto/asn1/tasn_enc.c:42:1: start of procedure ASN1_item_i2d()
    40.   }
    41.   
    42. > int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it)
    43.   {
    44.       return asn1_item_flags_i2d(val, out, it, 0);

crypto/asn1/tasn_enc.c:44:5: 
    42.   int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it)
    43.   {
    44. >     return asn1_item_flags_i2d(val, out, it, 0);
    45.   }
    46.   

crypto/asn1/tasn_enc.c:54:1: start of procedure asn1_item_flags_i2d()
      52.    */
      53.   
      54. > static int asn1_item_flags_i2d(ASN1_VALUE *val, unsigned char **out,
      55.                                  const ASN1_ITEM *it, int flags)
      56.   {

crypto/asn1/tasn_enc.c:57:9: Taking false branch
      55.                                  const ASN1_ITEM *it, int flags)
      56.   {
      57.       if (out && !*out) {
                    ^
      58.           unsigned char *p, *buf;
      59.           int len;

crypto/asn1/tasn_enc.c:72:5: Skipping ASN1_item_ex_i2d(): empty list of specs
      70.       }
      71.   
      72.       return ASN1_item_ex_i2d(&val, out, it, -1, flags);
                ^
      73.   }
      74.   

crypto/asn1/tasn_enc.c:73:1: return from a call to asn1_item_flags_i2d
      71.   
      72.       return ASN1_item_ex_i2d(&val, out, it, -1, flags);
      73. > }
      74.   
      75.   /*

crypto/asn1/tasn_enc.c:45:1: return from a call to ASN1_item_i2d
    43.   {
    44.       return asn1_item_flags_i2d(val, out, it, 0);
    45. > }
    46.   
    47.   /*

crypto/x509/x_name.c:86:1: return from a call to i2d_X509_NAME
  84.   IMPLEMENT_EXTERN_ASN1(X509_NAME, V_ASN1_SEQUENCE, x509_name_ff)
  85.   
  86. > IMPLEMENT_ASN1_FUNCTIONS(X509_NAME)
  87.   
  88.   IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME)

crypto/x509/x509_cmp.c:218:5: 
216.       /* Make sure X509_NAME structure contains valid cached encoding */
217.       i2d_X509_NAME(x, NULL);
218. >     EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
219.       if (EVP_DigestInit_ex(md_ctx, EVP_md5(), NULL)
220.           && EVP_DigestUpdate(md_ctx, x->bytes->data, x->bytes->length)

crypto/evp/evp_lib.c:469:1: start of procedure EVP_MD_CTX_set_flags()
  467.   }
  468.   
  469. > void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags)
  470.   {
  471.       ctx->flags |= flags;

crypto/evp/evp_lib.c:471:5: 
  469.   void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags)
  470.   {
  471. >     ctx->flags |= flags;
  472.   }
  473.   

crypto/evp/evp_lib.c:472:1: return from a call to EVP_MD_CTX_set_flags
  470.   {
  471.       ctx->flags |= flags;
  472. > }
  473.   
  474.   void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags)

crypto/x509/x509_cmp.c:219:9: 
217.       i2d_X509_NAME(x, NULL);
218.       EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
219. >     if (EVP_DigestInit_ex(md_ctx, EVP_md5(), NULL)
220.           && EVP_DigestUpdate(md_ctx, x->bytes->data, x->bytes->length)
221.           && EVP_DigestFinal_ex(md_ctx, md, NULL))

crypto/evp/m_md5.c:51:1: start of procedure EVP_md5()
  49.   };
  50.   
  51. > const EVP_MD *EVP_md5(void)
  52.   {
  53.       return (&md5_md);

crypto/evp/m_md5.c:53:5: 
  51.   const EVP_MD *EVP_md5(void)
  52.   {
  53. >     return (&md5_md);
  54.   }
  55.   #endif

crypto/evp/m_md5.c:54:1: return from a call to EVP_md5
  52.   {
  53.       return (&md5_md);
  54. > }
  55.   #endif

crypto/x509/x509_cmp.c:219:9: Taking false branch
217.       i2d_X509_NAME(x, NULL);
218.       EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
219.       if (EVP_DigestInit_ex(md_ctx, EVP_md5(), NULL)
               ^
220.           && EVP_DigestUpdate(md_ctx, x->bytes->data, x->bytes->length)
221.           && EVP_DigestFinal_ex(md_ctx, md, NULL))

crypto/x509/x509_cmp.c:225:5: 
223.                  ((unsigned long)md[2] << 16L) | ((unsigned long)md[3] << 24L)
224.               ) & 0xffffffffL;
225. >     EVP_MD_CTX_free(md_ctx);
226.   
227.       return (ret);

crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free()
  47.   }
  48.   
  49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
            ^
  52.       OPENSSL_free(ctx);
  53.   }

crypto/evp/digest.c:52:5: 
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
  52. >     OPENSSL_free(ctx);
  53.   }
  54.   

crypto/mem.c:252:1: start of procedure CRYPTO_free()
    250.   }
    251.   
    252. > void CRYPTO_free(void *str, const char *file, int line)
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:254:9: Taking true branch
    252.   void CRYPTO_free(void *str, const char *file, int line)
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    255.           free_impl(str, file, line);
    256.           return;

crypto/mem.c:254:30: Taking true branch
    252.   void CRYPTO_free(void *str, const char *file, int line)
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    255.           free_impl(str, file, line);
    256.           return;

crypto/mem.c:255:9: Skipping __function_pointer__(): unresolved function pointer
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    255.           free_impl(str, file, line);
                   ^
    256.           return;
    257.       }

crypto/mem.c:256:9: 
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    255.           free_impl(str, file, line);
    256. >         return;
    257.       }
    258.   

crypto/mem.c:270:1: return from a call to CRYPTO_free
    268.       free(str);
    269.   #endif
    270. > }
    271.   
    272.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free
  51.       EVP_MD_CTX_reset(ctx);
  52.       OPENSSL_free(ctx);
  53. > }
  54.   
  55.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
