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


ssl/tls13_enc.c:601:1: start of procedure tls13_export_keying_material()
599.   }
600.   
601. > int tls13_export_keying_material(SSL *s, unsigned char *out, size_t olen,
602.                                    const char *label, size_t llen,
603.                                    const unsigned char *context,

ssl/tls13_enc.c:607:5: 
605.   {
606.       unsigned char exportsecret[EVP_MAX_MD_SIZE];
607. >     static const unsigned char exporterlabel[] = "exporter";
608.       unsigned char hash[EVP_MAX_MD_SIZE];
609.       const EVP_MD *md = ssl_handshake_md(s);

ssl/tls13_enc.c:609:5: 
607.       static const unsigned char exporterlabel[] = "exporter";
608.       unsigned char hash[EVP_MAX_MD_SIZE];
609. >     const EVP_MD *md = ssl_handshake_md(s);
610.       EVP_MD_CTX *ctx = EVP_MD_CTX_new();
611.       unsigned int hashsize;

test/tls13secretstest.c:171:1: start of procedure ssl_handshake_md()
  169.   }
  170.   
  171. > const EVP_MD *ssl_handshake_md(SSL *s)
  172.   {
  173.       return EVP_sha256();

test/tls13secretstest.c:173:5: 
  171.   const EVP_MD *ssl_handshake_md(SSL *s)
  172.   {
  173. >     return EVP_sha256();
  174.   }
  175.   

crypto/evp/m_sha1.c:171:1: start of procedure EVP_sha256()
    169.   };
    170.   
    171. > const EVP_MD *EVP_sha256(void)
    172.   {
    173.       return (&sha256_md);

crypto/evp/m_sha1.c:173:5: 
    171.   const EVP_MD *EVP_sha256(void)
    172.   {
    173. >     return (&sha256_md);
    174.   }
    175.   

crypto/evp/m_sha1.c:174:1: return from a call to EVP_sha256
    172.   {
    173.       return (&sha256_md);
    174. > }
    175.   
    176.   static int init384(EVP_MD_CTX *ctx)

test/tls13secretstest.c:174:1: return from a call to ssl_handshake_md
  172.   {
  173.       return EVP_sha256();
  174. > }
  175.   
  176.   void RECORD_LAYER_reset_read_sequence(RECORD_LAYER *rl)

ssl/tls13_enc.c:610:5: 
608.       unsigned char hash[EVP_MAX_MD_SIZE];
609.       const EVP_MD *md = ssl_handshake_md(s);
610. >     EVP_MD_CTX *ctx = EVP_MD_CTX_new();
611.       unsigned int hashsize;
612.       int ret = 0;

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:194:1: start of procedure CRYPTO_zalloc()
    192.   }
    193.   
    194. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    195.   {
    196.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:196:5: 
    194.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    195.   {
    196. >     void *ret = CRYPTO_malloc(num, file, line);
    197.   
    198.       FAILTEST();

crypto/mem.c:166:1: start of procedure CRYPTO_malloc()
      164.   #endif
      165.   
      166. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      167.   {
      168.       void *ret = NULL;

crypto/mem.c:168:5: 
      166.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      167.   {
      168. >     void *ret = NULL;
      169.   
      170.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:170:9: Taking false branch
      168.       void *ret = NULL;
      169.   
      170.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      171.           return malloc_impl(num, file, line);
      172.   

crypto/mem.c:173:9: Taking false branch
      171.           return malloc_impl(num, file, line);
      172.   
      173.       if (num == 0)
                     ^
      174.           return NULL;
      175.   

crypto/mem.c:177:5: 
      175.   
      176.       FAILTEST();
      177. >     allow_customize = 0;
      178.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      179.       if (call_malloc_debug) {

crypto/mem.c:187:5: 
      185.       }
      186.   #else
      187. >     osslargused(file); osslargused(line);
      188.       ret = malloc(num);
      189.   #endif

crypto/mem.c:187:24: 
      185.       }
      186.   #else
      187. >     osslargused(file); osslargused(line);
      188.       ret = malloc(num);
      189.   #endif

crypto/mem.c:188:5: 
      186.   #else
      187.       osslargused(file); osslargused(line);
      188. >     ret = malloc(num);
      189.   #endif
      190.   

crypto/mem.c:191:5: 
      189.   #endif
      190.   
      191. >     return ret;
      192.   }
      193.   

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

crypto/mem.c:199:9: Taking true branch
    197.   
    198.       FAILTEST();
    199.       if (ret != NULL)
                   ^
    200.           memset(ret, 0, num);
    201.       return ret;

crypto/mem.c:200:9: 
    198.       FAILTEST();
    199.       if (ret != NULL)
    200. >         memset(ret, 0, num);
    201.       return ret;
    202.   }

crypto/mem.c:201:5: 
    199.       if (ret != NULL)
    200.           memset(ret, 0, num);
    201. >     return ret;
    202.   }
    203.   

crypto/mem.c:202:1: return from a call to CRYPTO_zalloc
    200.           memset(ret, 0, num);
    201.       return ret;
    202. > }
    203.   
    204.   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/tls13_enc.c:612:5: 
610.       EVP_MD_CTX *ctx = EVP_MD_CTX_new();
611.       unsigned int hashsize;
612. >     int ret = 0;
613.   
614.       if (ctx == NULL || !SSL_is_init_finished(s))

ssl/tls13_enc.c:614:9: Taking false branch
612.       int ret = 0;
613.   
614.       if (ctx == NULL || !SSL_is_init_finished(s))
               ^
615.           goto err;
616.   

ssl/tls13_enc.c:614:25: 
612.       int ret = 0;
613.   
614. >     if (ctx == NULL || !SSL_is_init_finished(s))
615.           goto err;
616.   

ssl/statem/statem.c:74:1: start of procedure SSL_is_init_finished()
  72.   }
  73.   
  74. > int SSL_is_init_finished(SSL *s)
  75.   {
  76.       return !(s->statem.in_init) && (s->statem.hand_state == TLS_ST_OK);

ssl/statem/statem.c:76:13: Condition is true
  74.   int SSL_is_init_finished(SSL *s)
  75.   {
  76.       return !(s->statem.in_init) && (s->statem.hand_state == TLS_ST_OK);
                    ^
  77.   }
  78.   

ssl/statem/statem.c:76:37: Condition is true
  74.   int SSL_is_init_finished(SSL *s)
  75.   {
  76.       return !(s->statem.in_init) && (s->statem.hand_state == TLS_ST_OK);
                                            ^
  77.   }
  78.   

ssl/statem/statem.c:76:12: 
  74.   int SSL_is_init_finished(SSL *s)
  75.   {
  76. >     return !(s->statem.in_init) && (s->statem.hand_state == TLS_ST_OK);
  77.   }
  78.   

ssl/statem/statem.c:76:5: 
  74.   int SSL_is_init_finished(SSL *s)
  75.   {
  76. >     return !(s->statem.in_init) && (s->statem.hand_state == TLS_ST_OK);
  77.   }
  78.   

ssl/statem/statem.c:77:1: return from a call to SSL_is_init_finished
  75.   {
  76.       return !(s->statem.in_init) && (s->statem.hand_state == TLS_ST_OK);
  77. > }
  78.   
  79.   int SSL_in_before(SSL *s)

ssl/tls13_enc.c:614:25: Taking false branch
612.       int ret = 0;
613.   
614.       if (ctx == NULL || !SSL_is_init_finished(s))
                               ^
615.           goto err;
616.   

ssl/tls13_enc.c:617:10: Taking false branch
615.           goto err;
616.   
617.       if (!use_context)
                ^
618.           contextlen = 0;
619.   

ssl/tls13_enc.c:620:9: Taking false branch
618.           contextlen = 0;
619.   
620.       if (EVP_DigestInit_ex(ctx, md, NULL) <= 0
               ^
621.               || EVP_DigestUpdate(ctx, context, contextlen) <= 0
622.               || EVP_DigestFinal_ex(ctx, hash, &hashsize) <= 0

ssl/tls13_enc.c:621:16: 
619.   
620.       if (EVP_DigestInit_ex(ctx, md, NULL) <= 0
621. >             || EVP_DigestUpdate(ctx, context, contextlen) <= 0
622.               || EVP_DigestFinal_ex(ctx, hash, &hashsize) <= 0
623.               || !tls13_hkdf_expand(s, md, s->exporter_master_secret,

crypto/evp/digest.c:146:1: start of procedure EVP_DigestUpdate()
  144.   }
  145.   
  146. > int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
  147.   {
  148.       return ctx->update(ctx, data, count);

crypto/evp/digest.c:148:5: Skipping __function_pointer__(): unresolved function pointer
  146.   int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
  147.   {
  148.       return ctx->update(ctx, data, count);
             ^
  149.   }
  150.   

crypto/evp/digest.c:149:1: return from a call to EVP_DigestUpdate
  147.   {
  148.       return ctx->update(ctx, data, count);
  149. > }
  150.   
  151.   /* The caller can assume that this removes any secret data from the context */

ssl/tls13_enc.c:621:16: Taking true branch
619.   
620.       if (EVP_DigestInit_ex(ctx, md, NULL) <= 0
621.               || EVP_DigestUpdate(ctx, context, contextlen) <= 0
                      ^
622.               || EVP_DigestFinal_ex(ctx, hash, &hashsize) <= 0
623.               || !tls13_hkdf_expand(s, md, s->exporter_master_secret,

ssl/tls13_enc.c:631:2: 
629.   
630.       ret = 1;
631. >  err:
632.       EVP_MD_CTX_free(ctx);
633.       return ret;

ssl/tls13_enc.c:632:5: 
630.       ret = 1;
631.    err:
632. >     EVP_MD_CTX_free(ctx);
633.       return ret;
634.   }

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:261:1: start of procedure CRYPTO_free()
    259.   }
    260.   
    261. > void CRYPTO_free(void *str, const char *file, int line)
    262.   {
    263.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:263:9: Taking true branch
    261.   void CRYPTO_free(void *str, const char *file, int line)
    262.   {
    263.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    264.           free_impl(str, file, line);
    265.           return;

crypto/mem.c:263:30: Taking true branch
    261.   void CRYPTO_free(void *str, const char *file, int line)
    262.   {
    263.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    264.           free_impl(str, file, line);
    265.           return;

crypto/mem.c:264:9: Skipping __function_pointer__(): unresolved function pointer
    262.   {
    263.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    264.           free_impl(str, file, line);
                   ^
    265.           return;
    266.       }

crypto/mem.c:265:9: 
    263.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    264.           free_impl(str, file, line);
    265. >         return;
    266.       }
    267.   

crypto/mem.c:279:1: return from a call to CRYPTO_free
    277.       free(str);
    278.   #endif
    279. > }
    280.   
    281.   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)
