ssl/ssl_lib.c:3791: error: MEMORY_LEAK
  memory dynamically allocated to `*hash` by call to `EVP_MD_CTX_new()` at line 3788, column 13 is not reachable after line 3791, column 9.
Showing all 49 steps of the trace


ssl/ssl_lib.c:3785:1: start of procedure ssl_replace_hash()
3783.    */
3784.   
3785. > EVP_MD_CTX *ssl_replace_hash(EVP_MD_CTX **hash, const EVP_MD *md)
3786.   {
3787.       ssl_clear_hash_ctx(hash);

ssl/ssl_lib.c:3787:5: 
3785.   EVP_MD_CTX *ssl_replace_hash(EVP_MD_CTX **hash, const EVP_MD *md)
3786.   {
3787. >     ssl_clear_hash_ctx(hash);
3788.       *hash = EVP_MD_CTX_new();
3789.       if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) {

ssl/ssl_lib.c:3797:1: start of procedure ssl_clear_hash_ctx()
  3795.   }
  3796.   
  3797. > void ssl_clear_hash_ctx(EVP_MD_CTX **hash)
  3798.   {
  3799.   

ssl/ssl_lib.c:3800:5: 
  3798.   {
  3799.   
  3800. >     EVP_MD_CTX_free(*hash);
  3801.       *hash = NULL;
  3802.   }

crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free()
    47.   }
    48.   
    49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
    50.   {
    51.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs
    49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
    50.   {
    51.       EVP_MD_CTX_reset(ctx);
              ^
    52.       OPENSSL_free(ctx);
    53.   }

crypto/evp/digest.c:52:5: 
    50.   {
    51.       EVP_MD_CTX_reset(ctx);
    52. >     OPENSSL_free(ctx);
    53.   }
    54.   

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 false 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:268:5: 
      266.       }
      267.   #else
      268. >     free(str);
      269.   #endif
      270.   }

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/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free
    51.       EVP_MD_CTX_reset(ctx);
    52.       OPENSSL_free(ctx);
    53. > }
    54.   
    55.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)

ssl/ssl_lib.c:3801:5: 
  3799.   
  3800.       EVP_MD_CTX_free(*hash);
  3801. >     *hash = NULL;
  3802.   }
  3803.   

ssl/ssl_lib.c:3802:1: return from a call to ssl_clear_hash_ctx
  3800.       EVP_MD_CTX_free(*hash);
  3801.       *hash = NULL;
  3802. > }
  3803.   
  3804.   /* Retrieve handshake hashes */

ssl/ssl_lib.c:3788:5: 
3786.   {
3787.       ssl_clear_hash_ctx(hash);
3788. >     *hash = EVP_MD_CTX_new();
3789.       if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) {
3790.           EVP_MD_CTX_free(*hash);

crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new()
  42.   }
  43.   
  44. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:46:5: 
  44.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47.   }
  48.   

crypto/mem.c:185:1: start of procedure CRYPTO_zalloc()
    183.   }
    184.   
    185. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    186.   {
    187.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:187:5: 
    185.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    186.   {
    187. >     void *ret = CRYPTO_malloc(num, file, line);
    188.   
    189.       FAILTEST();

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/mem.c:190:9: Taking true branch
    188.   
    189.       FAILTEST();
    190.       if (ret != NULL)
                   ^
    191.           memset(ret, 0, num);
    192.       return ret;

crypto/mem.c:191:9: 
    189.       FAILTEST();
    190.       if (ret != NULL)
    191. >         memset(ret, 0, num);
    192.       return ret;
    193.   }

crypto/mem.c:192:5: 
    190.       if (ret != NULL)
    191.           memset(ret, 0, num);
    192. >     return ret;
    193.   }
    194.   

crypto/mem.c:193:1: return from a call to CRYPTO_zalloc
    191.           memset(ret, 0, num);
    192.       return ret;
    193. > }
    194.   
    195.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47. > }
  48.   
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

ssl/ssl_lib.c:3789:9: Taking false branch
3787.       ssl_clear_hash_ctx(hash);
3788.       *hash = EVP_MD_CTX_new();
3789.       if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) {
                ^
3790.           EVP_MD_CTX_free(*hash);
3791.           *hash = NULL;

ssl/ssl_lib.c:3789:27: Taking true branch
3787.       ssl_clear_hash_ctx(hash);
3788.       *hash = EVP_MD_CTX_new();
3789.       if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) {
                                  ^
3790.           EVP_MD_CTX_free(*hash);
3791.           *hash = NULL;

ssl/ssl_lib.c:3789:33: Taking true branch
3787.       ssl_clear_hash_ctx(hash);
3788.       *hash = EVP_MD_CTX_new();
3789.       if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) {
                                        ^
3790.           EVP_MD_CTX_free(*hash);
3791.           *hash = NULL;

ssl/ssl_lib.c:3790:9: 
3788.       *hash = EVP_MD_CTX_new();
3789.       if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) {
3790. >         EVP_MD_CTX_free(*hash);
3791.           *hash = NULL;
3792.           return NULL;

crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free()
  47.   }
  48.   
  49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
            ^
  52.       OPENSSL_free(ctx);
  53.   }

crypto/evp/digest.c:52:5: 
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
  52. >     OPENSSL_free(ctx);
  53.   }
  54.   

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/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free
  51.       EVP_MD_CTX_reset(ctx);
  52.       OPENSSL_free(ctx);
  53. > }
  54.   
  55.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)

ssl/ssl_lib.c:3791:9: 
3789.       if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) {
3790.           EVP_MD_CTX_free(*hash);
3791. >         *hash = NULL;
3792.           return NULL;
3793.       }
