ssl/statem/statem_clnt.c:2642: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 2584, column 12 is not reachable after line 2642, column 5.
Showing all 50 steps of the trace


ssl/statem/statem_clnt.c:2573:1: start of procedure tls_construct_client_verify()
2571.   }
2572.   
2573. > int tls_construct_client_verify(SSL *s)
2574.   {
2575.       unsigned char *p;

ssl/statem/statem_clnt.c:2577:5: 
2575.       unsigned char *p;
2576.       EVP_PKEY *pkey;
2577. >     const EVP_MD *md = s->s3->tmp.md[s->cert->key - s->cert->pkeys];
2578.       EVP_MD_CTX *mctx;
2579.       unsigned u = 0;

ssl/statem/statem_clnt.c:2579:5: 
2577.       const EVP_MD *md = s->s3->tmp.md[s->cert->key - s->cert->pkeys];
2578.       EVP_MD_CTX *mctx;
2579. >     unsigned u = 0;
2580.       unsigned long n = 0;
2581.       long hdatalen = 0;

ssl/statem/statem_clnt.c:2580:5: 
2578.       EVP_MD_CTX *mctx;
2579.       unsigned u = 0;
2580. >     unsigned long n = 0;
2581.       long hdatalen = 0;
2582.       void *hdata;

ssl/statem/statem_clnt.c:2581:5: 
2579.       unsigned u = 0;
2580.       unsigned long n = 0;
2581. >     long hdatalen = 0;
2582.       void *hdata;
2583.   

ssl/statem/statem_clnt.c:2584:5: 
2582.       void *hdata;
2583.   
2584. >     mctx = EVP_MD_CTX_new();
2585.       if (mctx == NULL) {
2586.           SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_MALLOC_FAILURE);

crypto/evp/digest.c:145:1: start of procedure EVP_MD_CTX_new()
  143.   }
  144.   
  145. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  146.   {
  147.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:147:5: 
  145.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  146.   {
  147. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  148.   }
  149.   

crypto/mem.c:146:1: start of procedure CRYPTO_zalloc()
    144.   }
    145.   
    146. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    147.   {
    148.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:148:5: 
    146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    147.   {
    148. >     void *ret = CRYPTO_malloc(num, file, line);
    149.   
    150.       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. >     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/mem.c:150:9: Taking true branch
    148.       void *ret = CRYPTO_malloc(num, file, line);
    149.   
    150.       if (ret != NULL)
                   ^
    151.           memset(ret, 0, num);
    152.       return ret;

crypto/mem.c:151:9: 
    149.   
    150.       if (ret != NULL)
    151. >         memset(ret, 0, num);
    152.       return ret;
    153.   }

crypto/mem.c:152:5: 
    150.       if (ret != NULL)
    151.           memset(ret, 0, num);
    152. >     return ret;
    153.   }
    154.   

crypto/mem.c:153:1: return from a call to CRYPTO_zalloc
    151.           memset(ret, 0, num);
    152.       return ret;
    153. > }
    154.   
    155.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:148:1: return from a call to EVP_MD_CTX_new
  146.   {
  147.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  148. > }
  149.   
  150.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

ssl/statem/statem_clnt.c:2585:9: Taking false branch
2583.   
2584.       mctx = EVP_MD_CTX_new();
2585.       if (mctx == NULL) {
                ^
2586.           SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_MALLOC_FAILURE);
2587.           goto err;

ssl/statem/statem_clnt.c:2590:5: 
2588.       }
2589.   
2590. >     p = ssl_handshake_start(s);
2591.       pkey = s->cert->key->privatekey;
2592.   

ssl/statem/statem_clnt.c:2591:5: 
2589.   
2590.       p = ssl_handshake_start(s);
2591. >     pkey = s->cert->key->privatekey;
2592.   
2593.       hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata);

ssl/statem/statem_clnt.c:2593:5: 
2591.       pkey = s->cert->key->privatekey;
2592.   
2593. >     hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata);
2594.       if (hdatalen <= 0) {
2595.           SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR);

crypto/bio/bio_lib.c:389:1: start of procedure BIO_ctrl()
  387.   }
  388.   
  389. > long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
  390.   {
  391.       long ret;

crypto/bio/bio_lib.c:394:9: Taking false branch
  392.       long (*cb) (BIO *, int, const char *, int, long, long);
  393.   
  394.       if (b == NULL)
                 ^
  395.           return (0);
  396.   

crypto/bio/bio_lib.c:397:10: Taking false branch
  395.           return (0);
  396.   
  397.       if ((b->method == NULL) || (b->method->ctrl == NULL)) {
                  ^
  398.           BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
  399.           return (-2);

crypto/bio/bio_lib.c:397:33: Taking true branch
  395.           return (0);
  396.   
  397.       if ((b->method == NULL) || (b->method->ctrl == NULL)) {
                                         ^
  398.           BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
  399.           return (-2);

crypto/bio/bio_lib.c:398:9: Skipping ERR_put_error(): empty list of specs
  396.   
  397.       if ((b->method == NULL) || (b->method->ctrl == NULL)) {
  398.           BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
                 ^
  399.           return (-2);
  400.       }

crypto/bio/bio_lib.c:399:9: 
  397.       if ((b->method == NULL) || (b->method->ctrl == NULL)) {
  398.           BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
  399. >         return (-2);
  400.       }
  401.   

crypto/bio/bio_lib.c:413:1: return from a call to BIO_ctrl
  411.           ret = cb(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, cmd, larg, ret);
  412.       return (ret);
  413. > }
  414.   
  415.   long BIO_callback_ctrl(BIO *b, int cmd,

ssl/statem/statem_clnt.c:2594:9: Taking true branch
2592.   
2593.       hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata);
2594.       if (hdatalen <= 0) {
                ^
2595.           SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR);
2596.           goto err;

ssl/statem/statem_clnt.c:2595:9: Skipping ERR_put_error(): empty list of specs
2593.       hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata);
2594.       if (hdatalen <= 0) {
2595.           SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR);
                ^
2596.           goto err;
2597.       }

ssl/statem/statem_clnt.c:2641:2: 
2639.       EVP_MD_CTX_free(mctx);
2640.       return 1;
2641. >  err:
2642.       EVP_MD_CTX_free(mctx);
2643.       return 0;

ssl/statem/statem_clnt.c:2642:5: 
2640.       return 1;
2641.    err:
2642. >     EVP_MD_CTX_free(mctx);
2643.       return 0;
2644.   }

crypto/evp/digest.c:150:1: start of procedure EVP_MD_CTX_free()
  148.   }
  149.   
  150. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  151.   {
  152.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:152:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  150.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  151.   {
  152.       EVP_MD_CTX_reset(ctx);
             ^
  153.       OPENSSL_free(ctx);
  154.   }

crypto/evp/digest.c:153:5: 
  151.   {
  152.       EVP_MD_CTX_reset(ctx);
  153. >     OPENSSL_free(ctx);
  154.   }
  155.   

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/evp/digest.c:154:1: return from a call to EVP_MD_CTX_free
  152.       EVP_MD_CTX_reset(ctx);
  153.       OPENSSL_free(ctx);
  154. > }
  155.   
  156.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
