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


crypto/kdf/tls1_prf.c:284:1: start of procedure tls1_prf_alg()
282.   }
283.   
284. > static int tls1_prf_alg(const EVP_MD *md,
285.                           const unsigned char *sec, size_t slen,
286.                           const unsigned char *seed, size_t seed_len,

crypto/kdf/tls1_prf.c:290:9: 
288.   {
289.   
290. >     if (EVP_MD_type(md) == NID_md5_sha1) {
291.           size_t i;
292.           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:290:9: Taking true branch
288.   {
289.   
290.       if (EVP_MD_type(md) == NID_md5_sha1) {
               ^
291.           size_t i;
292.           unsigned char *tmp;

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

crypto/kdf/tls1_prf.c:297:9: 
295.               return 0;
296.   
297. >         tmp = OPENSSL_malloc(olen);
298.           if (tmp == NULL)
299.               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: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/kdf/tls1_prf.c:298:13: Taking false branch
296.   
297.           tmp = OPENSSL_malloc(olen);
298.           if (tmp == NULL)
                   ^
299.               return 0;
300.           if (!tls1_prf_P_hash(EVP_sha1(), sec + slen/2, slen/2 + (slen & 1),

crypto/kdf/tls1_prf.c:300:14: 
298.           if (tmp == NULL)
299.               return 0;
300. >         if (!tls1_prf_P_hash(EVP_sha1(), sec + slen/2, slen/2 + (slen & 1),
301.                            seed, seed_len, tmp, olen)) {
302.               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:300:14: Taking true branch
298.           if (tmp == NULL)
299.               return 0;
300.           if (!tls1_prf_P_hash(EVP_sha1(), sec + slen/2, slen/2 + (slen & 1),
                    ^
301.                            seed, seed_len, tmp, olen)) {
302.               OPENSSL_clear_free(tmp, olen);

crypto/kdf/tls1_prf.c:302:13: 
300.           if (!tls1_prf_P_hash(EVP_sha1(), sec + slen/2, slen/2 + (slen & 1),
301.                            seed, seed_len, tmp, olen)) {
302. >             OPENSSL_clear_free(tmp, olen);
303.               return 0;
304.           }

crypto/mem.c:230:1: start of procedure CRYPTO_clear_free()
  228.   }
  229.   
  230. > void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
  231.   {
  232.       if (str == NULL)

crypto/mem.c:232:9: Taking false branch
  230.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
  231.   {
  232.       if (str == NULL)
                 ^
  233.           return;
  234.       if (num)

crypto/mem.c:234:9: Taking true branch
  232.       if (str == NULL)
  233.           return;
  234.       if (num)
                 ^
  235.           OPENSSL_cleanse(str, num);
  236.       CRYPTO_free(str, file, line);

crypto/mem.c:235:9: Skipping OPENSSL_cleanse(): method has no implementation
  233.           return;
  234.       if (num)
  235.           OPENSSL_cleanse(str, num);
                 ^
  236.       CRYPTO_free(str, file, line);
  237.   }

crypto/mem.c:236:5: 
  234.       if (num)
  235.           OPENSSL_cleanse(str, num);
  236. >     CRYPTO_free(str, file, line);
  237.   }

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