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


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

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

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

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

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

crypto/evp/evp_lib.c:304:1: start of procedure EVP_CIPHER_key_length()
  302.   }
  303.   
  304. > int EVP_CIPHER_key_length(const EVP_CIPHER *cipher)
  305.   {
  306.       return cipher->key_len;

crypto/evp/evp_lib.c:306:5: 
  304.   int EVP_CIPHER_key_length(const EVP_CIPHER *cipher)
  305.   {
  306. >     return cipher->key_len;
  307.   }
  308.   

crypto/evp/evp_lib.c:307:1: return from a call to EVP_CIPHER_key_length
  305.   {
  306.       return cipher->key_len;
  307. > }
  308.   
  309.   int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx)

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

crypto/evp/evp_lib.c:264:1: start of procedure EVP_CIPHER_iv_length()
  262.   }
  263.   
  264. > int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
  265.   {
  266.       return cipher->iv_len;

crypto/evp/evp_lib.c:266:5: 
  264.   int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
  265.   {
  266. >     return cipher->iv_len;
  267.   }
  268.   

crypto/evp/evp_lib.c:267:1: return from a call to EVP_CIPHER_iv_length
  265.   {
  266.       return cipher->iv_len;
  267. > }
  268.   
  269.   int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx)

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

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

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

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

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:158:1: start of procedure CRYPTO_zalloc()
    156.   }
    157.   
    158. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    159.   {
    160.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:160:5: 
    158.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    159.   {
    160. >     void *ret = CRYPTO_malloc(num, file, line);
    161.   
    162.       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:155:5: 
      153.   #endif
      154.   
      155. >     return ret;
      156.   }
      157.   

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

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

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

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

crypto/mem.c:165:1: return from a call to CRYPTO_zalloc
    163.           memset(ret, 0, num);
    164.       return ret;
    165. > }
    166.   
    167.   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/evp/evp_key.c:139:9: Taking false branch
137.   
138.       c = EVP_MD_CTX_new();
139.       if (c == NULL)
               ^
140.           goto err;
141.       for (;;) {

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

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

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

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

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/evp/evp_key.c:147:14: Taking true branch
145.               if (!EVP_DigestUpdate(c, &(md_buf[0]), mds))
146.                   goto err;
147.           if (!EVP_DigestUpdate(c, data, datal))
                    ^
148.               goto err;
149.           if (salt != NULL)

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

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

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:222:1: start of procedure CRYPTO_free()
    220.   }
    221.   
    222. > void CRYPTO_free(void *str, const char *file, int line)
    223.   {
    224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

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

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

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

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

crypto/mem.c:240:1: return from a call to CRYPTO_free
    238.       free(str);
    239.   #endif
    240. > }
    241.   
    242.   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)
