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:71:1: start of procedure CRYPTO_malloc()
  69.   }
  70.   
  71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  72.   {
  73.       void *ret = NULL;

crypto/mem.c:73:5: 
  71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  72.   {
  73. >     void *ret = NULL;
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
  73.       void *ret = NULL;
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                ^
  76.           return malloc_impl(num, file, line);
  77.   

crypto/mem.c:78:9: Taking false branch
  76.           return malloc_impl(num, file, line);
  77.   
  78.       if (num <= 0)
                ^
  79.           return NULL;
  80.   

crypto/mem.c:81:5: 
  79.           return NULL;
  80.   
  81. >     allow_customize = 0;
  82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
  89.       }
  90.   #else
  91. >     osslargused(file); osslargused(line);
  92.       ret = malloc(num);
  93.   #endif

crypto/mem.c:91:24: 
  89.       }
  90.   #else
  91. >     osslargused(file); osslargused(line);
  92.       ret = malloc(num);
  93.   #endif

crypto/mem.c:92:5: 
  90.   #else
  91.       osslargused(file); osslargused(line);
  92. >     ret = malloc(num);
  93.   #endif
  94.   

crypto/mem.c:95:5: 
  93.   #endif
  94.   
  95. >     return ret;
  96.   }
  97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
  94.   
  95.       return ret;
  96. > }
  97.   
  98.   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:103:1: start of procedure EVP_sha1()
  101.   };
  102.   
  103. > const EVP_MD *EVP_sha1(void)
  104.   {
  105.       return (&sha1_md);

crypto/evp/m_sha1.c:105:5: 
  103.   const EVP_MD *EVP_sha1(void)
  104.   {
  105. >     return (&sha1_md);
  106.   }
  107.   

crypto/evp/m_sha1.c:106:1: return from a call to EVP_sha1
  104.   {
  105.       return (&sha1_md);
  106. > }
  107.   
  108.   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:183:1: start of procedure CRYPTO_clear_free()
  181.   }
  182.   
  183. > void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
  184.   {
  185.       if (str == NULL)

crypto/mem.c:185:9: Taking false branch
  183.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
  184.   {
  185.       if (str == NULL)
                 ^
  186.           return;
  187.       if (num)

crypto/mem.c:187:9: Taking true branch
  185.       if (str == NULL)
  186.           return;
  187.       if (num)
                 ^
  188.           OPENSSL_cleanse(str, num);
  189.       CRYPTO_free(str, file, line);

crypto/mem.c:188:9: Skipping OPENSSL_cleanse(): method has no implementation
  186.           return;
  187.       if (num)
  188.           OPENSSL_cleanse(str, num);
                 ^
  189.       CRYPTO_free(str, file, line);
  190.   }

crypto/mem.c:189:5: 
  187.       if (num)
  188.           OPENSSL_cleanse(str, num);
  189. >     CRYPTO_free(str, file, line);
  190.   }

crypto/mem.c:163:1: start of procedure CRYPTO_free()
    161.   }
    162.   
    163. > void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:165:9: Taking true branch
    163.   void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    166.           free_impl(str, file, line);
    167.           return;

crypto/mem.c:165:30: Taking true branch
    163.   void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    166.           free_impl(str, file, line);
    167.           return;

crypto/mem.c:166:9: Skipping __function_pointer__(): unresolved function pointer
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    166.           free_impl(str, file, line);
                   ^
    167.           return;
    168.       }

crypto/mem.c:167:9: 
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    166.           free_impl(str, file, line);
    167. >         return;
    168.       }
    169.   

crypto/mem.c:181:1: return from a call to CRYPTO_free
    179.       free(str);
    180.   #endif
    181. > }
    182.   
    183.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

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