crypto/evp/evp_key.c:195: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 140, column 9 is not reachable after line 195, column 5.
Showing all 56 steps of the trace


crypto/evp/evp_key.c:122:1: start of procedure EVP_BytesToKey()
120.   #endif /* OPENSSL_NO_UI */
121.   
122. > int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
123.                      const unsigned char *salt, const unsigned char *data,
124.                      int datal, int count, unsigned char *key,

crypto/evp/evp_key.c:129:5: 
127.       EVP_MD_CTX *c;
128.       unsigned char md_buf[EVP_MAX_MD_SIZE];
129. >     int niv, nkey, addmd = 0;
130.       unsigned int mds = 0, i;
131.       int rv = 0;

crypto/evp/evp_key.c:130:5: 
128.       unsigned char md_buf[EVP_MAX_MD_SIZE];
129.       int niv, nkey, addmd = 0;
130. >     unsigned int mds = 0, i;
131.       int rv = 0;
132.       nkey = EVP_CIPHER_key_length(type);

crypto/evp/evp_key.c:131:5: 
129.       int niv, nkey, addmd = 0;
130.       unsigned int mds = 0, i;
131. >     int rv = 0;
132.       nkey = EVP_CIPHER_key_length(type);
133.       niv = EVP_CIPHER_iv_length(type);

crypto/evp/evp_key.c:132:5: 
130.       unsigned int mds = 0, i;
131.       int rv = 0;
132. >     nkey = EVP_CIPHER_key_length(type);
133.       niv = EVP_CIPHER_iv_length(type);
134.       OPENSSL_assert(nkey <= EVP_MAX_KEY_LENGTH);

crypto/evp/evp_lib.c:314:1: start of procedure EVP_CIPHER_key_length()
  312.   }
  313.   
  314. > int EVP_CIPHER_key_length(const EVP_CIPHER *cipher)
  315.   {
  316.       return cipher->key_len;

crypto/evp/evp_lib.c:316:5: 
  314.   int EVP_CIPHER_key_length(const EVP_CIPHER *cipher)
  315.   {
  316. >     return cipher->key_len;
  317.   }
  318.   

crypto/evp/evp_lib.c:317:1: return from a call to EVP_CIPHER_key_length
  315.   {
  316.       return cipher->key_len;
  317. > }
  318.   
  319.   int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx)

crypto/evp/evp_key.c:133:5: 
131.       int rv = 0;
132.       nkey = EVP_CIPHER_key_length(type);
133. >     niv = EVP_CIPHER_iv_length(type);
134.       OPENSSL_assert(nkey <= EVP_MAX_KEY_LENGTH);
135.       OPENSSL_assert(niv <= EVP_MAX_IV_LENGTH);

crypto/evp/evp_lib.c:274:1: start of procedure EVP_CIPHER_iv_length()
  272.   }
  273.   
  274. > int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
  275.   {
  276.       return cipher->iv_len;

crypto/evp/evp_lib.c:276:5: 
  274.   int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
  275.   {
  276. >     return cipher->iv_len;
  277.   }
  278.   

crypto/evp/evp_lib.c:277:1: return from a call to EVP_CIPHER_iv_length
  275.   {
  276.       return cipher->iv_len;
  277. > }
  278.   
  279.   int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx)

crypto/evp/evp_key.c:134:5: Condition is true
132.       nkey = EVP_CIPHER_key_length(type);
133.       niv = EVP_CIPHER_iv_length(type);
134.       OPENSSL_assert(nkey <= EVP_MAX_KEY_LENGTH);
           ^
135.       OPENSSL_assert(niv <= EVP_MAX_IV_LENGTH);
136.   

crypto/evp/evp_key.c:135:5: Condition is true
133.       niv = EVP_CIPHER_iv_length(type);
134.       OPENSSL_assert(nkey <= EVP_MAX_KEY_LENGTH);
135.       OPENSSL_assert(niv <= EVP_MAX_IV_LENGTH);
           ^
136.   
137.       if (data == NULL)

crypto/evp/evp_key.c:137:9: Taking false branch
135.       OPENSSL_assert(niv <= EVP_MAX_IV_LENGTH);
136.   
137.       if (data == NULL)
               ^
138.           return (nkey);
139.   

crypto/evp/evp_key.c:140:5: 
138.           return (nkey);
139.   
140. >     c = EVP_MD_CTX_new();
141.       if (c == NULL)
142.           goto err;

crypto/evp/digest.c:147:1: start of procedure EVP_MD_CTX_new()
  145.   }
  146.   
  147. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  148.   {
  149.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:149:5: 
  147.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  148.   {
  149. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  150.   }
  151.   

crypto/mem.c:146:1: start of procedure CRYPTO_zalloc()
    144.   }
    145.   
    146. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    147.   {
    148.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:148:5: 
    146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    147.   {
    148. >     void *ret = CRYPTO_malloc(num, file, line);
    149.   
    150.       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. >     osslargused(file); osslargused(line);
      140.       ret = malloc(num);
      141.   #endif

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

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

crypto/mem.c:143:5: 
      141.   #endif
      142.   
      143. >     return ret;
      144.   }
      145.   

crypto/mem.c:144:1: return from a call to CRYPTO_malloc
      142.   
      143.       return ret;
      144. > }
      145.   
      146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:150:9: Taking true branch
    148.       void *ret = CRYPTO_malloc(num, file, line);
    149.   
    150.       if (ret != NULL)
                   ^
    151.           memset(ret, 0, num);
    152.       return ret;

crypto/mem.c:151:9: 
    149.   
    150.       if (ret != NULL)
    151. >         memset(ret, 0, num);
    152.       return ret;
    153.   }

crypto/mem.c:152:5: 
    150.       if (ret != NULL)
    151.           memset(ret, 0, num);
    152. >     return ret;
    153.   }
    154.   

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

crypto/evp/digest.c:150:1: return from a call to EVP_MD_CTX_new
  148.   {
  149.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  150. > }
  151.   
  152.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

crypto/evp/evp_key.c:141:9: Taking false branch
139.   
140.       c = EVP_MD_CTX_new();
141.       if (c == NULL)
               ^
142.           goto err;
143.       for (;;) {

crypto/evp/evp_key.c:192:5: Loop condition is true. Entering loop body
190.           if ((nkey == 0) && (niv == 0))
191.               break;
192.       }
           ^
193.       rv = EVP_CIPHER_key_length(type);
194.    err:

crypto/evp/evp_key.c:144:14: Taking false branch
142.           goto err;
143.       for (;;) {
144.           if (!EVP_DigestInit_ex(c, md, NULL))
                    ^
145.               goto err;
146.           if (addmd++)

crypto/evp/evp_key.c:146:13: Taking false branch
144.           if (!EVP_DigestInit_ex(c, md, NULL))
145.               goto err;
146.           if (addmd++)
                   ^
147.               if (!EVP_DigestUpdate(c, &(md_buf[0]), mds))
148.                   goto err;

crypto/evp/evp_key.c:149:14: 
147.               if (!EVP_DigestUpdate(c, &(md_buf[0]), mds))
148.                   goto err;
149. >         if (!EVP_DigestUpdate(c, data, datal))
150.               goto err;
151.           if (salt != NULL)

crypto/evp/digest.c:249:1: start of procedure EVP_DigestUpdate()
  247.   }
  248.   
  249. > int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
  250.   {
  251.       return ctx->update(ctx, data, count);

crypto/evp/digest.c:251:5: Skipping __function_pointer__(): unresolved function pointer
  249.   int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
  250.   {
  251.       return ctx->update(ctx, data, count);
             ^
  252.   }
  253.   

crypto/evp/digest.c:252:1: return from a call to EVP_DigestUpdate
  250.   {
  251.       return ctx->update(ctx, data, count);
  252. > }
  253.   
  254.   /* The caller can assume that this removes any secret data from the context */

crypto/evp/evp_key.c:149:14: Taking true branch
147.               if (!EVP_DigestUpdate(c, &(md_buf[0]), mds))
148.                   goto err;
149.           if (!EVP_DigestUpdate(c, data, datal))
                    ^
150.               goto err;
151.           if (salt != NULL)

crypto/evp/evp_key.c:194:2: 
192.       }
193.       rv = EVP_CIPHER_key_length(type);
194. >  err:
195.       EVP_MD_CTX_free(c);
196.       OPENSSL_cleanse(md_buf, sizeof(md_buf));

crypto/evp/evp_key.c:195:5: 
193.       rv = EVP_CIPHER_key_length(type);
194.    err:
195. >     EVP_MD_CTX_free(c);
196.       OPENSSL_cleanse(md_buf, sizeof(md_buf));
197.       return rv;

crypto/evp/digest.c:152:1: start of procedure EVP_MD_CTX_free()
  150.   }
  151.   
  152. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  153.   {
  154.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:154:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  152.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  153.   {
  154.       EVP_MD_CTX_reset(ctx);
             ^
  155.       OPENSSL_free(ctx);
  156.   }

crypto/evp/digest.c:155:5: 
  153.   {
  154.       EVP_MD_CTX_reset(ctx);
  155. >     OPENSSL_free(ctx);
  156.   }
  157.   

crypto/mem.c:210:1: start of procedure CRYPTO_free()
    208.   }
    209.   
    210. > void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:212:9: Taking true branch
    210.   void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    213.           free_impl(str, file, line);
    214.           return;

crypto/mem.c:212:30: Taking true branch
    210.   void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    213.           free_impl(str, file, line);
    214.           return;

crypto/mem.c:213:9: Skipping __function_pointer__(): unresolved function pointer
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    213.           free_impl(str, file, line);
                   ^
    214.           return;
    215.       }

crypto/mem.c:214:9: 
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    213.           free_impl(str, file, line);
    214. >         return;
    215.       }
    216.   

crypto/mem.c:228:1: return from a call to CRYPTO_free
    226.       free(str);
    227.   #endif
    228. > }
    229.   
    230.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:156:1: return from a call to EVP_MD_CTX_free
  154.       EVP_MD_CTX_reset(ctx);
  155.       OPENSSL_free(ctx);
  156. > }
  157.   
  158.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
