ssl/s3_enc.c:491: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 458, column 23 is not reachable after line 491, column 5.
Showing all 40 steps of the trace


ssl/s3_enc.c:443:1: start of procedure ssl3_generate_master_secret()
441.   }
442.   
443. > int ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
444.                                   int len)
445.   {

ssl/s3_enc.c:446:5: 
444.                                   int len)
445.   {
446. >     static const unsigned char *salt[3] = {
447.   #ifndef CHARSET_EBCDIC
448.           (const unsigned char *)"A",

ssl/s3_enc.c:458:5: 
456.       };
457.       unsigned char buf[EVP_MAX_MD_SIZE];
458. >     EVP_MD_CTX *ctx = EVP_MD_CTX_new();
459.       int i, ret = 0;
460.       unsigned int n;

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:98:1: start of procedure CRYPTO_zalloc()
    96.   }
    97.   
    98. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    99.   {
    100.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:100:5: 
    98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    99.   {
    100. >     void *ret = CRYPTO_malloc(num, file, line);
    101.   
    102.       if (ret != NULL)

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/mem.c:102:9: Taking true branch
    100.       void *ret = CRYPTO_malloc(num, file, line);
    101.   
    102.       if (ret != NULL)
                   ^
    103.           memset(ret, 0, num);
    104.       return ret;

crypto/mem.c:103:9: 
    101.   
    102.       if (ret != NULL)
    103. >         memset(ret, 0, num);
    104.       return ret;
    105.   }

crypto/mem.c:104:5: 
    102.       if (ret != NULL)
    103.           memset(ret, 0, num);
    104. >     return ret;
    105.   }
    106.   

crypto/mem.c:105:1: return from a call to CRYPTO_zalloc
    103.           memset(ret, 0, num);
    104.       return ret;
    105. > }
    106.   
    107.   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/s3_enc.c:459:5: 
457.       unsigned char buf[EVP_MAX_MD_SIZE];
458.       EVP_MD_CTX *ctx = EVP_MD_CTX_new();
459. >     int i, ret = 0;
460.       unsigned int n;
461.   #ifdef OPENSSL_SSL_TRACE_CRYPTO

ssl/s3_enc.c:465:9: Taking false branch
463.   #endif
464.   
465.       if (ctx == NULL) {
               ^
466.           SSLerr(SSL_F_SSL3_GENERATE_MASTER_SECRET, ERR_R_MALLOC_FAILURE);
467.           return 0;

ssl/s3_enc.c:469:10: 
467.           return 0;
468.       }
469. >     for (i = 0; i < 3; i++) {
470.           if (EVP_DigestInit_ex(ctx, s->ctx->sha1, NULL) <= 0
471.                   || EVP_DigestUpdate(ctx, salt[i],

ssl/s3_enc.c:469:17: Loop condition is true. Entering loop body
467.           return 0;
468.       }
469.       for (i = 0; i < 3; i++) {
                       ^
470.           if (EVP_DigestInit_ex(ctx, s->ctx->sha1, NULL) <= 0
471.                   || EVP_DigestUpdate(ctx, salt[i],

ssl/s3_enc.c:470:13: Taking true branch
468.       }
469.       for (i = 0; i < 3; i++) {
470.           if (EVP_DigestInit_ex(ctx, s->ctx->sha1, NULL) <= 0
                   ^
471.                   || EVP_DigestUpdate(ctx, salt[i],
472.                                       strlen((const char *)salt[i])) <= 0

ssl/s3_enc.c:484:13: Skipping ERR_put_error(): empty list of specs
482.                   || EVP_DigestUpdate(ctx, buf, n) <= 0
483.                   || EVP_DigestFinal_ex(ctx, out, &n) <= 0) {
484.               SSLerr(SSL_F_SSL3_GENERATE_MASTER_SECRET, ERR_R_INTERNAL_ERROR);
                   ^
485.               ret = 0;
486.               break;

ssl/s3_enc.c:485:13: 
483.                   || EVP_DigestFinal_ex(ctx, out, &n) <= 0) {
484.               SSLerr(SSL_F_SSL3_GENERATE_MASTER_SECRET, ERR_R_INTERNAL_ERROR);
485. >             ret = 0;
486.               break;
487.           }

ssl/s3_enc.c:491:5: 
489.           ret += n;
490.       }
491. >     EVP_MD_CTX_free(ctx);
492.   
493.   #ifdef OPENSSL_SSL_TRACE_CRYPTO

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: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/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)
