crypto/ec/curve448/eddsa.c:234: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 142, column 27 is not reachable after line 234, column 5.
Showing all 57 steps of the trace


crypto/ec/curve448/eddsa.c:133:1: start of procedure c448_ed448_sign()
131.   }
132.   
133. > c448_error_t c448_ed448_sign(
134.                           uint8_t signature[EDDSA_448_SIGNATURE_BYTES],
135.                           const uint8_t privkey[EDDSA_448_PRIVATE_BYTES],

crypto/ec/curve448/eddsa.c:142:5: 
140.   {
141.       curve448_scalar_t secret_scalar;
142. >     EVP_MD_CTX *hashctx = EVP_MD_CTX_new();
143.       c448_error_t ret = C448_FAILURE;
144.       curve448_scalar_t nonce_scalar;

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)

crypto/ec/curve448/eddsa.c:143:5: 
141.       curve448_scalar_t secret_scalar;
142.       EVP_MD_CTX *hashctx = EVP_MD_CTX_new();
143. >     c448_error_t ret = C448_FAILURE;
144.       curve448_scalar_t nonce_scalar;
145.       uint8_t nonce_point[EDDSA_448_PUBLIC_BYTES] = { 0 };

crypto/ec/curve448/eddsa.c:145:5: 
143.       c448_error_t ret = C448_FAILURE;
144.       curve448_scalar_t nonce_scalar;
145. >     uint8_t nonce_point[EDDSA_448_PUBLIC_BYTES] = { 0 };
146.       unsigned int c;
147.       curve448_scalar_t challenge_scalar;

crypto/ec/curve448/eddsa.c:149:9: Taking false branch
147.       curve448_scalar_t challenge_scalar;
148.   
149.       if (hashctx == NULL)
               ^
150.           return C448_FAILURE;
151.   

crypto/ec/curve448/eddsa.c:159:14: 
157.           uint8_t expanded[EDDSA_448_PRIVATE_BYTES * 2];
158.   
159. >         if (!oneshot_hash(expanded, sizeof(expanded), privkey,
160.                             EDDSA_448_PRIVATE_BYTES))
161.               goto err;

crypto/ec/curve448/eddsa.c:23:1: start of procedure oneshot_hash()
  21.   #define COFACTOR 4
  22.   
  23. > static c448_error_t oneshot_hash(uint8_t *out, size_t outlen,
  24.                                    const uint8_t *in, size_t inlen)
  25.   {

crypto/ec/curve448/eddsa.c:26:5: 
  24.                                    const uint8_t *in, size_t inlen)
  25.   {
  26. >     EVP_MD_CTX *hashctx = EVP_MD_CTX_new();
  27.   
  28.       if (hashctx == NULL)

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 true 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:197:32: Taking true 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:198:9: Skipping __function_pointer__(): unresolved function pointer
        196.       INCREMENT(malloc_count);
        197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
        198.           return malloc_impl(num, file, line);
                       ^
        199.   
        200.       if (num == 0)

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 false branch
      224.   
      225.       FAILTEST();
      226.       if (ret != NULL)
                     ^
      227.           memset(ret, 0, num);
      228.       return ret;

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)

crypto/ec/curve448/eddsa.c:28:9: Taking true branch
  26.       EVP_MD_CTX *hashctx = EVP_MD_CTX_new();
  27.   
  28.       if (hashctx == NULL)
                ^
  29.           return C448_FAILURE;
  30.   

crypto/ec/curve448/eddsa.c:29:9: 
  27.   
  28.       if (hashctx == NULL)
  29. >         return C448_FAILURE;
  30.   
  31.       if (!EVP_DigestInit_ex(hashctx, EVP_shake256(), NULL)

crypto/ec/curve448/eddsa.c:40:1: return from a call to oneshot_hash
  38.       EVP_MD_CTX_free(hashctx);
  39.       return C448_SUCCESS;
  40. > }
  41.   
  42.   static void clamp(uint8_t secret_scalar_ser[EDDSA_448_PRIVATE_BYTES])

crypto/ec/curve448/eddsa.c:159:14: Taking true branch
157.           uint8_t expanded[EDDSA_448_PRIVATE_BYTES * 2];
158.   
159.           if (!oneshot_hash(expanded, sizeof(expanded), privkey,
                    ^
160.                             EDDSA_448_PRIVATE_BYTES))
161.               goto err;

crypto/ec/curve448/eddsa.c:233:2: 
231.   
232.       ret = C448_SUCCESS;
233. >  err:
234.       EVP_MD_CTX_free(hashctx);
235.       return ret;

crypto/ec/curve448/eddsa.c:234:5: 
232.       ret = C448_SUCCESS;
233.    err:
234. >     EVP_MD_CTX_free(hashctx);
235.       return ret;
236.   }

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)
