crypto/kdf/tls1_prf.c:271: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_malloc()` at line 266, column 15 is not reachable after line 271, column 13.
Showing all 41 steps of the trace


crypto/kdf/tls1_prf.c:253:1: start of procedure tls1_prf_alg()
251.   }
252.   
253. > static int tls1_prf_alg(const EVP_MD *md,
254.                           const unsigned char *sec, size_t slen,
255.                           const unsigned char *seed, size_t seed_len,

crypto/kdf/tls1_prf.c:259:9: 
257.   {
258.   
259. >     if (EVP_MD_type(md) == NID_md5_sha1) {
260.           size_t i;
261.           unsigned char *tmp;

crypto/evp/evp_lib.c:329:1: start of procedure EVP_MD_type()
  327.   }
  328.   
  329. > int EVP_MD_type(const EVP_MD *md)
  330.   {
  331.       return md->type;

crypto/evp/evp_lib.c:331:5: 
  329.   int EVP_MD_type(const EVP_MD *md)
  330.   {
  331. >     return md->type;
  332.   }
  333.   

crypto/evp/evp_lib.c:332:1: return from a call to EVP_MD_type
  330.   {
  331.       return md->type;
  332. > }
  333.   
  334.   int EVP_MD_pkey_type(const EVP_MD *md)

crypto/kdf/tls1_prf.c:259:9: Taking true branch
257.   {
258.   
259.       if (EVP_MD_type(md) == NID_md5_sha1) {
               ^
260.           size_t i;
261.           unsigned char *tmp;

crypto/kdf/tls1_prf.c:262:14: 
260.           size_t i;
261.           unsigned char *tmp;
262. >         if (!tls1_prf_P_hash(EVP_md5(), sec, slen/2 + (slen & 1),
263.                            seed, seed_len, out, olen))
264.               return 0;

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/kdf/tls1_prf.c:262:14: Taking false branch
260.           size_t i;
261.           unsigned char *tmp;
262.           if (!tls1_prf_P_hash(EVP_md5(), sec, slen/2 + (slen & 1),
                    ^
263.                            seed, seed_len, out, olen))
264.               return 0;

crypto/kdf/tls1_prf.c:266:9: 
264.               return 0;
265.   
266. >         tmp = OPENSSL_malloc(olen);
267.           if (tmp == NULL)
268.               return 0;

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/kdf/tls1_prf.c:267:13: Taking false branch
265.   
266.           tmp = OPENSSL_malloc(olen);
267.           if (tmp == NULL)
                   ^
268.               return 0;
269.           if (!tls1_prf_P_hash(EVP_sha1(), sec + slen/2, slen/2 + (slen & 1),

crypto/kdf/tls1_prf.c:269:14: 
267.           if (tmp == NULL)
268.               return 0;
269. >         if (!tls1_prf_P_hash(EVP_sha1(), sec + slen/2, slen/2 + (slen & 1),
270.                            seed, seed_len, tmp, olen)) {
271.               OPENSSL_clear_free(tmp, olen);

crypto/evp/m_sha1.c:153:1: start of procedure EVP_sha1()
  151.   };
  152.   
  153. > const EVP_MD *EVP_sha1(void)
  154.   {
  155.       return (&sha1_md);

crypto/evp/m_sha1.c:155:5: 
  153.   const EVP_MD *EVP_sha1(void)
  154.   {
  155. >     return (&sha1_md);
  156.   }
  157.   

crypto/evp/m_sha1.c:156:1: return from a call to EVP_sha1
  154.   {
  155.       return (&sha1_md);
  156. > }
  157.   
  158.   static int init224(EVP_MD_CTX *ctx)

crypto/kdf/tls1_prf.c:269:14: Taking true branch
267.           if (tmp == NULL)
268.               return 0;
269.           if (!tls1_prf_P_hash(EVP_sha1(), sec + slen/2, slen/2 + (slen & 1),
                    ^
270.                            seed, seed_len, tmp, olen)) {
271.               OPENSSL_clear_free(tmp, olen);

crypto/kdf/tls1_prf.c:271:13: 
269.           if (!tls1_prf_P_hash(EVP_sha1(), sec + slen/2, slen/2 + (slen & 1),
270.                            seed, seed_len, tmp, olen)) {
271. >             OPENSSL_clear_free(tmp, olen);
272.               return 0;
273.           }

crypto/mem.c:242:1: start of procedure CRYPTO_clear_free()
  240.   }
  241.   
  242. > void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
  243.   {
  244.       if (str == NULL)

crypto/mem.c:244:9: Taking false branch
  242.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
  243.   {
  244.       if (str == NULL)
                 ^
  245.           return;
  246.       if (num)

crypto/mem.c:246:9: Taking true branch
  244.       if (str == NULL)
  245.           return;
  246.       if (num)
                 ^
  247.           OPENSSL_cleanse(str, num);
  248.       CRYPTO_free(str, file, line);

crypto/mem.c:247:9: Skipping OPENSSL_cleanse(): method has no implementation
  245.           return;
  246.       if (num)
  247.           OPENSSL_cleanse(str, num);
                 ^
  248.       CRYPTO_free(str, file, line);
  249.   }

crypto/mem.c:248:5: 
  246.       if (num)
  247.           OPENSSL_cleanse(str, num);
  248. >     CRYPTO_free(str, file, line);
  249.   }

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/mem.c:249:1: return from a call to CRYPTO_clear_free
  247.           OPENSSL_cleanse(str, num);
  248.       CRYPTO_free(str, file, line);
  249. > }
