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


ssl/tls13_enc.c:668:1: start of procedure tls13_export_keying_material()
666.   }
667.   
668. > int tls13_export_keying_material(SSL *s, unsigned char *out, size_t olen,
669.                                    const char *label, size_t llen,
670.                                    const unsigned char *context,

ssl/tls13_enc.c:674:5: 
672.   {
673.       unsigned char exportsecret[EVP_MAX_MD_SIZE];
674. >     static const unsigned char exporterlabel[] = "exporter";
675.       unsigned char hash[EVP_MAX_MD_SIZE], data[EVP_MAX_MD_SIZE];
676.       const EVP_MD *md = ssl_handshake_md(s);

ssl/tls13_enc.c:676:5: 
674.       static const unsigned char exporterlabel[] = "exporter";
675.       unsigned char hash[EVP_MAX_MD_SIZE], data[EVP_MAX_MD_SIZE];
676. >     const EVP_MD *md = ssl_handshake_md(s);
677.       EVP_MD_CTX *ctx = EVP_MD_CTX_new();
678.       unsigned int hashsize, datalen;

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:177:1: start of procedure EVP_sha256()
    175.   };
    176.   
    177. > const EVP_MD *EVP_sha256(void)
    178.   {
    179.       return &sha256_md;

crypto/evp/m_sha1.c:179:5: 
    177.   const EVP_MD *EVP_sha256(void)
    178.   {
    179. >     return &sha256_md;
    180.   }
    181.   

crypto/evp/m_sha1.c:180:1: return from a call to EVP_sha256
    178.   {
    179.       return &sha256_md;
    180. > }
    181.   
    182.   static int init512_224(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:677:5: 
675.       unsigned char hash[EVP_MAX_MD_SIZE], data[EVP_MAX_MD_SIZE];
676.       const EVP_MD *md = ssl_handshake_md(s);
677. >     EVP_MD_CTX *ctx = EVP_MD_CTX_new();
678.       unsigned int hashsize, datalen;
679.       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:221:1: start of procedure CRYPTO_zalloc()
    219.   }
    220.   
    221. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    222.   {
    223.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:223:5: 
    221.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    222.   {
    223. >     void *ret = CRYPTO_malloc(num, file, line);
    224.   
    225.       FAILTEST();

crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
      190.   #endif
      191.   
      192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      193.   {
      194.       void *ret = NULL;

crypto/mem.c:194:5: 
      192.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      193.   {
      194. >     void *ret = NULL;
      195.   
      196.       INCREMENT(malloc_count);

crypto/mem.c:197:9: Taking false branch
      195.   
      196.       INCREMENT(malloc_count);
      197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      198.           return malloc_impl(num, file, line);
      199.   

crypto/mem.c:200:9: Taking false branch
      198.           return malloc_impl(num, file, line);
      199.   
      200.       if (num == 0)
                     ^
      201.           return NULL;
      202.   

crypto/mem.c:204:5: 
      202.   
      203.       FAILTEST();
      204. >     allow_customize = 0;
      205.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      206.       if (call_malloc_debug) {

crypto/mem.c:214:5: 
      212.       }
      213.   #else
      214. >     (void)(file); (void)(line);
      215.       ret = malloc(num);
      216.   #endif

crypto/mem.c:214:19: 
      212.       }
      213.   #else
      214. >     (void)(file); (void)(line);
      215.       ret = malloc(num);
      216.   #endif

crypto/mem.c:215:5: 
      213.   #else
      214.       (void)(file); (void)(line);
      215. >     ret = malloc(num);
      216.   #endif
      217.   

crypto/mem.c:218:5: 
      216.   #endif
      217.   
      218. >     return ret;
      219.   }
      220.   

crypto/mem.c:219:1: return from a call to CRYPTO_malloc
      217.   
      218.       return ret;
      219. > }
      220.   
      221.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:226:9: Taking true branch
    224.   
    225.       FAILTEST();
    226.       if (ret != NULL)
                   ^
    227.           memset(ret, 0, num);
    228.       return ret;

crypto/mem.c:227:9: 
    225.       FAILTEST();
    226.       if (ret != NULL)
    227. >         memset(ret, 0, num);
    228.       return ret;
    229.   }

crypto/mem.c:228:5: 
    226.       if (ret != NULL)
    227.           memset(ret, 0, num);
    228. >     return ret;
    229.   }
    230.   

crypto/mem.c:229:1: return from a call to CRYPTO_zalloc
    227.           memset(ret, 0, num);
    228.       return ret;
    229. > }
    230.   
    231.   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:679:5: 
677.       EVP_MD_CTX *ctx = EVP_MD_CTX_new();
678.       unsigned int hashsize, datalen;
679. >     int ret = 0;
680.   
681.       if (ctx == NULL || !ossl_statem_export_allowed(s))

ssl/tls13_enc.c:681:9: Taking false branch
679.       int ret = 0;
680.   
681.       if (ctx == NULL || !ossl_statem_export_allowed(s))
               ^
682.           goto err;
683.   

ssl/tls13_enc.c:681:25: 
679.       int ret = 0;
680.   
681. >     if (ctx == NULL || !ossl_statem_export_allowed(s))
682.           goto err;
683.   

test/tls13secretstest.c:215:1: start of procedure ossl_statem_export_allowed()
  213.   }
  214.   
  215. > int ossl_statem_export_allowed(SSL *s)
  216.   {
  217.       return 1;

test/tls13secretstest.c:217:5: 
  215.   int ossl_statem_export_allowed(SSL *s)
  216.   {
  217. >     return 1;
  218.   }
  219.   

test/tls13secretstest.c:218:1: return from a call to ossl_statem_export_allowed
  216.   {
  217.       return 1;
  218. > }
  219.   
  220.   int ossl_statem_export_early_allowed(SSL *s)

ssl/tls13_enc.c:681:25: Taking false branch
679.       int ret = 0;
680.   
681.       if (ctx == NULL || !ossl_statem_export_allowed(s))
                               ^
682.           goto err;
683.   

ssl/tls13_enc.c:684:10: Taking false branch
682.           goto err;
683.   
684.       if (!use_context)
                ^
685.           contextlen = 0;
686.   

ssl/tls13_enc.c:687:9: Taking false branch
685.           contextlen = 0;
686.   
687.       if (EVP_DigestInit_ex(ctx, md, NULL) <= 0
               ^
688.               || EVP_DigestUpdate(ctx, context, contextlen) <= 0
689.               || EVP_DigestFinal_ex(ctx, hash, &hashsize) <= 0

ssl/tls13_enc.c:688:16: 
686.   
687.       if (EVP_DigestInit_ex(ctx, md, NULL) <= 0
688. >             || EVP_DigestUpdate(ctx, context, contextlen) <= 0
689.               || EVP_DigestFinal_ex(ctx, hash, &hashsize) <= 0
690.               || EVP_DigestInit_ex(ctx, md, NULL) <= 0

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:688:16: Taking true branch
686.   
687.       if (EVP_DigestInit_ex(ctx, md, NULL) <= 0
688.               || EVP_DigestUpdate(ctx, context, contextlen) <= 0
                      ^
689.               || EVP_DigestFinal_ex(ctx, hash, &hashsize) <= 0
690.               || EVP_DigestInit_ex(ctx, md, NULL) <= 0

ssl/tls13_enc.c:701:2: 
699.   
700.       ret = 1;
701. >  err:
702.       EVP_MD_CTX_free(ctx);
703.       return ret;

ssl/tls13_enc.c:702:5: 
700.       ret = 1;
701.    err:
702. >     EVP_MD_CTX_free(ctx);
703.       return ret;
704.   }

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:289:1: start of procedure CRYPTO_free()
    287.   }
    288.   
    289. > void CRYPTO_free(void *str, const char *file, int line)
    290.   {
    291.       INCREMENT(free_count);

crypto/mem.c:292:9: Taking true branch
    290.   {
    291.       INCREMENT(free_count);
    292.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    293.           free_impl(str, file, line);
    294.           return;

crypto/mem.c:292:30: Taking true branch
    290.   {
    291.       INCREMENT(free_count);
    292.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    293.           free_impl(str, file, line);
    294.           return;

crypto/mem.c:293:9: Skipping __function_pointer__(): unresolved function pointer
    291.       INCREMENT(free_count);
    292.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    293.           free_impl(str, file, line);
                   ^
    294.           return;
    295.       }

crypto/mem.c:294:9: 
    292.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    293.           free_impl(str, file, line);
    294. >         return;
    295.       }
    296.   

crypto/mem.c:308:1: return from a call to CRYPTO_free
    306.       free(str);
    307.   #endif
    308. > }
    309.   
    310.   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)
