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


ssl/tls13_enc.c:711:1: start of procedure tls13_export_keying_material()
709.   }
710.   
711. > int tls13_export_keying_material(SSL *s, unsigned char *out, size_t olen,
712.                                    const char *label, size_t llen,
713.                                    const unsigned char *context,

ssl/tls13_enc.c:717:5: 
715.   {
716.       unsigned char exportsecret[EVP_MAX_MD_SIZE];
717. >     static const unsigned char exporterlabel[] = "exporter";
718.       unsigned char hash[EVP_MAX_MD_SIZE], data[EVP_MAX_MD_SIZE];
719.       const EVP_MD *md = ssl_handshake_md(s);

ssl/tls13_enc.c:719:5: 
717.       static const unsigned char exporterlabel[] = "exporter";
718.       unsigned char hash[EVP_MAX_MD_SIZE], data[EVP_MAX_MD_SIZE];
719. >     const EVP_MD *md = ssl_handshake_md(s);
720.       EVP_MD_CTX *ctx = EVP_MD_CTX_new();
721.       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:720:5: 
718.       unsigned char hash[EVP_MAX_MD_SIZE], data[EVP_MAX_MD_SIZE];
719.       const EVP_MD *md = ssl_handshake_md(s);
720. >     EVP_MD_CTX *ctx = EVP_MD_CTX_new();
721.       unsigned int hashsize, datalen;
722.       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:228:1: start of procedure CRYPTO_zalloc()
    226.   }
    227.   
    228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    229.   {
    230.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:230:5: 
    228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    229.   {
    230. >     void *ret = CRYPTO_malloc(num, file, line);
    231.   
    232.       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:9: Taking true branch
      202.   
      203.       FAILTEST();
      204.       if (allow_customize) {
                     ^
      205.           /*
      206.            * Disallow customization after the first allocation. We only set this

crypto/mem.c:210:9: 
      208.            * allocation.
      209.            */
      210. >         allow_customize = 0;
      211.       }
      212.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:221:5: 
      219.       }
      220.   #else
      221. >     (void)(file); (void)(line);
      222.       ret = malloc(num);
      223.   #endif

crypto/mem.c:221:19: 
      219.       }
      220.   #else
      221. >     (void)(file); (void)(line);
      222.       ret = malloc(num);
      223.   #endif

crypto/mem.c:222:5: 
      220.   #else
      221.       (void)(file); (void)(line);
      222. >     ret = malloc(num);
      223.   #endif
      224.   

crypto/mem.c:225:5: 
      223.   #endif
      224.   
      225. >     return ret;
      226.   }
      227.   

crypto/mem.c:226:1: return from a call to CRYPTO_malloc
      224.   
      225.       return ret;
      226. > }
      227.   
      228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:233:9: Taking true branch
    231.   
    232.       FAILTEST();
    233.       if (ret != NULL)
                   ^
    234.           memset(ret, 0, num);
    235.       return ret;

crypto/mem.c:234:9: 
    232.       FAILTEST();
    233.       if (ret != NULL)
    234. >         memset(ret, 0, num);
    235.       return ret;
    236.   }

crypto/mem.c:235:5: 
    233.       if (ret != NULL)
    234.           memset(ret, 0, num);
    235. >     return ret;
    236.   }
    237.   

crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
    234.           memset(ret, 0, num);
    235.       return ret;
    236. > }
    237.   
    238.   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:722:5: 
720.       EVP_MD_CTX *ctx = EVP_MD_CTX_new();
721.       unsigned int hashsize, datalen;
722. >     int ret = 0;
723.   
724.       if (ctx == NULL || !ossl_statem_export_allowed(s))

ssl/tls13_enc.c:724:9: Taking false branch
722.       int ret = 0;
723.   
724.       if (ctx == NULL || !ossl_statem_export_allowed(s))
               ^
725.           goto err;
726.   

ssl/tls13_enc.c:724:25: 
722.       int ret = 0;
723.   
724. >     if (ctx == NULL || !ossl_statem_export_allowed(s))
725.           goto err;
726.   

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:724:25: Taking false branch
722.       int ret = 0;
723.   
724.       if (ctx == NULL || !ossl_statem_export_allowed(s))
                               ^
725.           goto err;
726.   

ssl/tls13_enc.c:727:10: Taking false branch
725.           goto err;
726.   
727.       if (!use_context)
                ^
728.           contextlen = 0;
729.   

ssl/tls13_enc.c:730:9: Taking true branch
728.           contextlen = 0;
729.   
730.       if (EVP_DigestInit_ex(ctx, md, NULL) <= 0
               ^
731.               || EVP_DigestUpdate(ctx, context, contextlen) <= 0
732.               || EVP_DigestFinal_ex(ctx, hash, &hashsize) <= 0

ssl/tls13_enc.c:744:2: 
742.   
743.       ret = 1;
744. >  err:
745.       EVP_MD_CTX_free(ctx);
746.       return ret;

ssl/tls13_enc.c:745:5: 
743.       ret = 1;
744.    err:
745. >     EVP_MD_CTX_free(ctx);
746.       return ret;
747.   }

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:295:1: start of procedure CRYPTO_free()
    293.   }
    294.   
    295. > void CRYPTO_free(void *str, const char *file, int line)
    296.   {
    297.       INCREMENT(free_count);

crypto/mem.c:298:9: Taking true branch
    296.   {
    297.       INCREMENT(free_count);
    298.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    299.           free_impl(str, file, line);
    300.           return;

crypto/mem.c:298:30: Taking true branch
    296.   {
    297.       INCREMENT(free_count);
    298.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    299.           free_impl(str, file, line);
    300.           return;

crypto/mem.c:299:9: Skipping __function_pointer__(): unresolved function pointer
    297.       INCREMENT(free_count);
    298.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    299.           free_impl(str, file, line);
                   ^
    300.           return;
    301.       }

crypto/mem.c:300:9: 
    298.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    299.           free_impl(str, file, line);
    300. >         return;
    301.       }
    302.   

crypto/mem.c:314:1: return from a call to CRYPTO_free
    312.       free(str);
    313.   #endif
    314. > }
    315.   
    316.   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)
