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


ssl/statem/statem_clnt.c:2556:1: start of procedure tls_construct_client_verify()
2554.   }
2555.   
2556. > int tls_construct_client_verify(SSL *s)
2557.   {
2558.       unsigned char *p;

ssl/statem/statem_clnt.c:2560:5: 
2558.       unsigned char *p;
2559.       EVP_PKEY *pkey;
2560. >     const EVP_MD *md = s->s3->tmp.md[s->cert->key - s->cert->pkeys];
2561.       EVP_MD_CTX *mctx;
2562.       unsigned u = 0;

ssl/statem/statem_clnt.c:2562:5: 
2560.       const EVP_MD *md = s->s3->tmp.md[s->cert->key - s->cert->pkeys];
2561.       EVP_MD_CTX *mctx;
2562. >     unsigned u = 0;
2563.       unsigned long n = 0;
2564.       long hdatalen = 0;

ssl/statem/statem_clnt.c:2563:5: 
2561.       EVP_MD_CTX *mctx;
2562.       unsigned u = 0;
2563. >     unsigned long n = 0;
2564.       long hdatalen = 0;
2565.       void *hdata;

ssl/statem/statem_clnt.c:2564:5: 
2562.       unsigned u = 0;
2563.       unsigned long n = 0;
2564. >     long hdatalen = 0;
2565.       void *hdata;
2566.   

ssl/statem/statem_clnt.c:2567:5: 
2565.       void *hdata;
2566.   
2567. >     mctx = EVP_MD_CTX_new();
2568.       if (mctx == NULL) {
2569.           SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_MALLOC_FAILURE);

crypto/evp/digest.c:152:1: start of procedure EVP_MD_CTX_new()
  150.   }
  151.   
  152. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:154:5: 
  152.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155.   }
  156.   

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

crypto/mem.c:160:5: 
    158.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    159.   {
    160. >     void *ret = CRYPTO_malloc(num, file, line);
    161.   
    162.       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: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/mem.c:162:9: Taking true branch
    160.       void *ret = CRYPTO_malloc(num, file, line);
    161.   
    162.       if (ret != NULL)
                   ^
    163.           memset(ret, 0, num);
    164.       return ret;

crypto/mem.c:163:9: 
    161.   
    162.       if (ret != NULL)
    163. >         memset(ret, 0, num);
    164.       return ret;
    165.   }

crypto/mem.c:164:5: 
    162.       if (ret != NULL)
    163.           memset(ret, 0, num);
    164. >     return ret;
    165.   }
    166.   

crypto/mem.c:165:1: return from a call to CRYPTO_zalloc
    163.           memset(ret, 0, num);
    164.       return ret;
    165. > }
    166.   
    167.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:155:1: return from a call to EVP_MD_CTX_new
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155. > }
  156.   
  157.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

ssl/statem/statem_clnt.c:2568:9: Taking false branch
2566.   
2567.       mctx = EVP_MD_CTX_new();
2568.       if (mctx == NULL) {
                ^
2569.           SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_MALLOC_FAILURE);
2570.           goto err;

ssl/statem/statem_clnt.c:2573:5: 
2571.       }
2572.   
2573. >     p = ssl_handshake_start(s);
2574.       pkey = s->cert->key->privatekey;
2575.   

ssl/statem/statem_clnt.c:2574:5: 
2572.   
2573.       p = ssl_handshake_start(s);
2574. >     pkey = s->cert->key->privatekey;
2575.   
2576.       hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata);

ssl/statem/statem_clnt.c:2576:5: 
2574.       pkey = s->cert->key->privatekey;
2575.   
2576. >     hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata);
2577.       if (hdatalen <= 0) {
2578.           SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR);

crypto/bio/bio_lib.c:331:1: start of procedure BIO_ctrl()
  329.   }
  330.   
  331. > long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
  332.   {
  333.       long ret;

crypto/bio/bio_lib.c:336:9: Taking false branch
  334.       long (*cb) (BIO *, int, const char *, int, long, long);
  335.   
  336.       if (b == NULL)
                 ^
  337.           return (0);
  338.   

crypto/bio/bio_lib.c:339:10: Taking false branch
  337.           return (0);
  338.   
  339.       if ((b->method == NULL) || (b->method->ctrl == NULL)) {
                  ^
  340.           BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
  341.           return (-2);

crypto/bio/bio_lib.c:339:33: Taking true branch
  337.           return (0);
  338.   
  339.       if ((b->method == NULL) || (b->method->ctrl == NULL)) {
                                         ^
  340.           BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
  341.           return (-2);

crypto/bio/bio_lib.c:340:9: Skipping ERR_put_error(): empty list of specs
  338.   
  339.       if ((b->method == NULL) || (b->method->ctrl == NULL)) {
  340.           BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
                 ^
  341.           return (-2);
  342.       }

crypto/bio/bio_lib.c:341:9: 
  339.       if ((b->method == NULL) || (b->method->ctrl == NULL)) {
  340.           BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
  341. >         return (-2);
  342.       }
  343.   

crypto/bio/bio_lib.c:355:1: return from a call to BIO_ctrl
  353.           ret = cb(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, cmd, larg, ret);
  354.       return (ret);
  355. > }
  356.   
  357.   long BIO_callback_ctrl(BIO *b, int cmd,

ssl/statem/statem_clnt.c:2577:9: Taking true branch
2575.   
2576.       hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata);
2577.       if (hdatalen <= 0) {
                ^
2578.           SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR);
2579.           goto err;

ssl/statem/statem_clnt.c:2578:9: Skipping ERR_put_error(): empty list of specs
2576.       hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata);
2577.       if (hdatalen <= 0) {
2578.           SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR);
                ^
2579.           goto err;
2580.       }

ssl/statem/statem_clnt.c:2624:2: 
2622.       EVP_MD_CTX_free(mctx);
2623.       return 1;
2624. >  err:
2625.       EVP_MD_CTX_free(mctx);
2626.       return 0;

ssl/statem/statem_clnt.c:2625:5: 
2623.       return 1;
2624.    err:
2625. >     EVP_MD_CTX_free(mctx);
2626.       return 0;
2627.   }

crypto/evp/digest.c:157:1: start of procedure EVP_MD_CTX_free()
  155.   }
  156.   
  157. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  158.   {
  159.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:159:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  157.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  158.   {
  159.       EVP_MD_CTX_reset(ctx);
             ^
  160.       OPENSSL_free(ctx);
  161.   }

crypto/evp/digest.c:160:5: 
  158.   {
  159.       EVP_MD_CTX_reset(ctx);
  160. >     OPENSSL_free(ctx);
  161.   }
  162.   

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/evp/digest.c:161:1: return from a call to EVP_MD_CTX_free
  159.       EVP_MD_CTX_reset(ctx);
  160.       OPENSSL_free(ctx);
  161. > }
  162.   
  163.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
