crypto/rsa/rsa_oaep.c:284: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 252, column 21 is not reachable after line 284, column 5.
Showing all 49 steps of the trace


crypto/rsa/rsa_oaep.c:247:1: start of procedure PKCS1_MGF1()
245.   }
246.   
247. > int PKCS1_MGF1(unsigned char *mask, long len,
248.                  const unsigned char *seed, long seedlen, const EVP_MD *dgst)
249.   {

crypto/rsa/rsa_oaep.c:250:5: 
248.                  const unsigned char *seed, long seedlen, const EVP_MD *dgst)
249.   {
250. >     long i, outlen = 0;
251.       unsigned char cnt[4];
252.       EVP_MD_CTX *c = EVP_MD_CTX_new();

crypto/rsa/rsa_oaep.c:252:5: 
250.       long i, outlen = 0;
251.       unsigned char cnt[4];
252. >     EVP_MD_CTX *c = EVP_MD_CTX_new();
253.       unsigned char md[EVP_MAX_MD_SIZE];
254.       int mdlen;

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)

crypto/rsa/rsa_oaep.c:255:5: 
253.       unsigned char md[EVP_MAX_MD_SIZE];
254.       int mdlen;
255. >     int rv = -1;
256.   
257.       if (c == NULL)

crypto/rsa/rsa_oaep.c:257:9: Taking false branch
255.       int rv = -1;
256.   
257.       if (c == NULL)
               ^
258.           goto err;
259.       mdlen = EVP_MD_size(dgst);

crypto/rsa/rsa_oaep.c:259:5: 
257.       if (c == NULL)
258.           goto err;
259. >     mdlen = EVP_MD_size(dgst);
260.       if (mdlen < 0)
261.           goto err;

crypto/evp/evp_lib.c:301:1: start of procedure EVP_MD_size()
  299.   }
  300.   
  301. > int EVP_MD_size(const EVP_MD *md)
  302.   {
  303.       if (!md) {

crypto/evp/evp_lib.c:303:10: Taking false branch
  301.   int EVP_MD_size(const EVP_MD *md)
  302.   {
  303.       if (!md) {
                  ^
  304.           EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);
  305.           return -1;

crypto/evp/evp_lib.c:307:5: 
  305.           return -1;
  306.       }
  307. >     return md->md_size;
  308.   }
  309.   

crypto/evp/evp_lib.c:308:1: return from a call to EVP_MD_size
  306.       }
  307.       return md->md_size;
  308. > }
  309.   
  310.   unsigned long EVP_MD_flags(const EVP_MD *md)

crypto/rsa/rsa_oaep.c:260:9: Taking false branch
258.           goto err;
259.       mdlen = EVP_MD_size(dgst);
260.       if (mdlen < 0)
               ^
261.           goto err;
262.       for (i = 0; outlen < len; i++) {

crypto/rsa/rsa_oaep.c:262:10: 
260.       if (mdlen < 0)
261.           goto err;
262. >     for (i = 0; outlen < len; i++) {
263.           cnt[0] = (unsigned char)((i >> 24) & 255);
264.           cnt[1] = (unsigned char)((i >> 16) & 255);

crypto/rsa/rsa_oaep.c:262:17: Loop condition is true. Entering loop body
260.       if (mdlen < 0)
261.           goto err;
262.       for (i = 0; outlen < len; i++) {
                       ^
263.           cnt[0] = (unsigned char)((i >> 24) & 255);
264.           cnt[1] = (unsigned char)((i >> 16) & 255);

crypto/rsa/rsa_oaep.c:263:9: 
261.           goto err;
262.       for (i = 0; outlen < len; i++) {
263. >         cnt[0] = (unsigned char)((i >> 24) & 255);
264.           cnt[1] = (unsigned char)((i >> 16) & 255);
265.           cnt[2] = (unsigned char)((i >> 8)) & 255;

crypto/rsa/rsa_oaep.c:264:9: 
262.       for (i = 0; outlen < len; i++) {
263.           cnt[0] = (unsigned char)((i >> 24) & 255);
264. >         cnt[1] = (unsigned char)((i >> 16) & 255);
265.           cnt[2] = (unsigned char)((i >> 8)) & 255;
266.           cnt[3] = (unsigned char)(i & 255);

crypto/rsa/rsa_oaep.c:265:9: 
263.           cnt[0] = (unsigned char)((i >> 24) & 255);
264.           cnt[1] = (unsigned char)((i >> 16) & 255);
265. >         cnt[2] = (unsigned char)((i >> 8)) & 255;
266.           cnt[3] = (unsigned char)(i & 255);
267.           if (!EVP_DigestInit_ex(c, dgst, NULL)

crypto/rsa/rsa_oaep.c:266:9: 
264.           cnt[1] = (unsigned char)((i >> 16) & 255);
265.           cnt[2] = (unsigned char)((i >> 8)) & 255;
266. >         cnt[3] = (unsigned char)(i & 255);
267.           if (!EVP_DigestInit_ex(c, dgst, NULL)
268.               || !EVP_DigestUpdate(c, seed, seedlen)

crypto/rsa/rsa_oaep.c:267:14: Taking true branch
265.           cnt[2] = (unsigned char)((i >> 8)) & 255;
266.           cnt[3] = (unsigned char)(i & 255);
267.           if (!EVP_DigestInit_ex(c, dgst, NULL)
                    ^
268.               || !EVP_DigestUpdate(c, seed, seedlen)
269.               || !EVP_DigestUpdate(c, cnt, 4))

crypto/rsa/rsa_oaep.c:283:2: 
281.       }
282.       rv = 0;
283. >  err:
284.       EVP_MD_CTX_free(c);
285.       return rv;

crypto/rsa/rsa_oaep.c:284:5: 
282.       rv = 0;
283.    err:
284. >     EVP_MD_CTX_free(c);
285.       return rv;
286.   }

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)
