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


crypto/kdf/tls1_prf.c:235:1: start of procedure tls1_prf_alg()
233.   }
234.   
235. > static int tls1_prf_alg(const EVP_MD *md,
236.                           const unsigned char *sec, size_t slen,
237.                           const unsigned char *seed, size_t seed_len,

crypto/kdf/tls1_prf.c:241:9: 
239.   {
240.   
241. >     if (EVP_MD_type(md) == NID_md5_sha1) {
242.           size_t i;
243.           unsigned char *tmp;

crypto/evp/evp_lib.c:291:1: start of procedure EVP_MD_type()
  289.   }
  290.   
  291. > int EVP_MD_type(const EVP_MD *md)
  292.   {
  293.       return md->type;

crypto/evp/evp_lib.c:293:5: 
  291.   int EVP_MD_type(const EVP_MD *md)
  292.   {
  293. >     return md->type;
  294.   }
  295.   

crypto/evp/evp_lib.c:294:1: return from a call to EVP_MD_type
  292.   {
  293.       return md->type;
  294. > }
  295.   
  296.   int EVP_MD_pkey_type(const EVP_MD *md)

crypto/kdf/tls1_prf.c:241:9: Taking true branch
239.   {
240.   
241.       if (EVP_MD_type(md) == NID_md5_sha1) {
               ^
242.           size_t i;
243.           unsigned char *tmp;

crypto/kdf/tls1_prf.c:244:14: 
242.           size_t i;
243.           unsigned char *tmp;
244. >         if (!tls1_prf_P_hash(EVP_md5(), sec, slen/2 + (slen & 1),
245.                            seed, seed_len, out, olen))
246.               return 0;

crypto/evp/m_md5.c:51:1: start of procedure EVP_md5()
  49.   };
  50.   
  51. > const EVP_MD *EVP_md5(void)
  52.   {
  53.       return (&md5_md);

crypto/evp/m_md5.c:53:5: 
  51.   const EVP_MD *EVP_md5(void)
  52.   {
  53. >     return (&md5_md);
  54.   }
  55.   #endif

crypto/evp/m_md5.c:54:1: return from a call to EVP_md5
  52.   {
  53.       return (&md5_md);
  54. > }
  55.   #endif

crypto/kdf/tls1_prf.c:244:14: Taking false branch
242.           size_t i;
243.           unsigned char *tmp;
244.           if (!tls1_prf_P_hash(EVP_md5(), sec, slen/2 + (slen & 1),
                    ^
245.                            seed, seed_len, out, olen))
246.               return 0;

crypto/kdf/tls1_prf.c:248:9: 
246.               return 0;
247.   
248. >         tmp = OPENSSL_malloc(olen);
249.           if (tmp == NULL)
250.               return 0;

crypto/mem.c:157:1: start of procedure CRYPTO_malloc()
  155.   #endif
  156.   
  157. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  158.   {
  159.       void *ret = NULL;

crypto/mem.c:159:5: 
  157.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  158.   {
  159. >     void *ret = NULL;
  160.   
  161.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:161:9: Taking false branch
  159.       void *ret = NULL;
  160.   
  161.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  162.           return malloc_impl(num, file, line);
  163.   

crypto/mem.c:164:9: Taking false branch
  162.           return malloc_impl(num, file, line);
  163.   
  164.       if (num <= 0)
                 ^
  165.           return NULL;
  166.   

crypto/mem.c:168:5: 
  166.   
  167.       FAILTEST();
  168. >     allow_customize = 0;
  169.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  170.       if (call_malloc_debug) {

crypto/mem.c:178:5: 
  176.       }
  177.   #else
  178. >     osslargused(file); osslargused(line);
  179.       ret = malloc(num);
  180.   #endif

crypto/mem.c:178:24: 
  176.       }
  177.   #else
  178. >     osslargused(file); osslargused(line);
  179.       ret = malloc(num);
  180.   #endif

crypto/mem.c:179:5: 
  177.   #else
  178.       osslargused(file); osslargused(line);
  179. >     ret = malloc(num);
  180.   #endif
  181.   

crypto/mem.c:182:5: 
  180.   #endif
  181.   
  182. >     return ret;
  183.   }
  184.   

crypto/mem.c:183:1: return from a call to CRYPTO_malloc
  181.   
  182.       return ret;
  183. > }
  184.   
  185.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/kdf/tls1_prf.c:249:13: Taking false branch
247.   
248.           tmp = OPENSSL_malloc(olen);
249.           if (tmp == NULL)
                   ^
250.               return 0;
251.           if (!tls1_prf_P_hash(EVP_sha1(), sec + slen/2, slen/2 + (slen & 1),

crypto/kdf/tls1_prf.c:251:14: 
249.           if (tmp == NULL)
250.               return 0;
251. >         if (!tls1_prf_P_hash(EVP_sha1(), sec + slen/2, slen/2 + (slen & 1),
252.                            seed, seed_len, tmp, olen)) {
253.               OPENSSL_clear_free(tmp, olen);

crypto/evp/m_sha1.c:108:1: start of procedure EVP_sha1()
  106.   };
  107.   
  108. > const EVP_MD *EVP_sha1(void)
  109.   {
  110.       return (&sha1_md);

crypto/evp/m_sha1.c:110:5: 
  108.   const EVP_MD *EVP_sha1(void)
  109.   {
  110. >     return (&sha1_md);
  111.   }
  112.   

crypto/evp/m_sha1.c:111:1: return from a call to EVP_sha1
  109.   {
  110.       return (&sha1_md);
  111. > }
  112.   
  113.   static int init224(EVP_MD_CTX *ctx)

crypto/kdf/tls1_prf.c:251:14: Taking true branch
249.           if (tmp == NULL)
250.               return 0;
251.           if (!tls1_prf_P_hash(EVP_sha1(), sec + slen/2, slen/2 + (slen & 1),
                    ^
252.                            seed, seed_len, tmp, olen)) {
253.               OPENSSL_clear_free(tmp, olen);

crypto/kdf/tls1_prf.c:253:13: 
251.           if (!tls1_prf_P_hash(EVP_sha1(), sec + slen/2, slen/2 + (slen & 1),
252.                            seed, seed_len, tmp, olen)) {
253. >             OPENSSL_clear_free(tmp, olen);
254.               return 0;
255.           }

crypto/mem.c:272:1: start of procedure CRYPTO_clear_free()
  270.   }
  271.   
  272. > void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
  273.   {
  274.       if (str == NULL)

crypto/mem.c:274:9: Taking false branch
  272.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
  273.   {
  274.       if (str == NULL)
                 ^
  275.           return;
  276.       if (num)

crypto/mem.c:276:9: Taking true branch
  274.       if (str == NULL)
  275.           return;
  276.       if (num)
                 ^
  277.           OPENSSL_cleanse(str, num);
  278.       CRYPTO_free(str, file, line);

crypto/mem.c:277:9: Skipping OPENSSL_cleanse(): method has no implementation
  275.           return;
  276.       if (num)
  277.           OPENSSL_cleanse(str, num);
                 ^
  278.       CRYPTO_free(str, file, line);
  279.   }

crypto/mem.c:278:5: 
  276.       if (num)
  277.           OPENSSL_cleanse(str, num);
  278. >     CRYPTO_free(str, file, line);
  279.   }

crypto/mem.c:252:1: start of procedure CRYPTO_free()
    250.   }
    251.   
    252. > void CRYPTO_free(void *str, const char *file, int line)
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:254:9: Taking true branch
    252.   void CRYPTO_free(void *str, const char *file, int line)
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    255.           free_impl(str, file, line);
    256.           return;

crypto/mem.c:254:30: Taking true branch
    252.   void CRYPTO_free(void *str, const char *file, int line)
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    255.           free_impl(str, file, line);
    256.           return;

crypto/mem.c:255:9: Skipping __function_pointer__(): unresolved function pointer
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    255.           free_impl(str, file, line);
                   ^
    256.           return;
    257.       }

crypto/mem.c:256:9: 
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    255.           free_impl(str, file, line);
    256. >         return;
    257.       }
    258.   

crypto/mem.c:270:1: return from a call to CRYPTO_free
    268.       free(str);
    269.   #endif
    270. > }
    271.   
    272.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/mem.c:279:1: return from a call to CRYPTO_clear_free
  277.           OPENSSL_cleanse(str, num);
  278.       CRYPTO_free(str, file, line);
  279. > }
