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: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/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: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)
