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


crypto/rsa/rsa_oaep.c:239:1: start of procedure PKCS1_MGF1()
237.   }
238.   
239. > int PKCS1_MGF1(unsigned char *mask, long len,
240.                  const unsigned char *seed, long seedlen, const EVP_MD *dgst)
241.   {

crypto/rsa/rsa_oaep.c:242:5: 
240.                  const unsigned char *seed, long seedlen, const EVP_MD *dgst)
241.   {
242. >     long i, outlen = 0;
243.       unsigned char cnt[4];
244.       EVP_MD_CTX *c = EVP_MD_CTX_new();

crypto/rsa/rsa_oaep.c:244:5: 
242.       long i, outlen = 0;
243.       unsigned char cnt[4];
244. >     EVP_MD_CTX *c = EVP_MD_CTX_new();
245.       unsigned char md[EVP_MAX_MD_SIZE];
246.       int mdlen;

crypto/evp/digest.c:152:1: start of procedure EVP_MD_CTX_new()
  150.   }
  151.   
  152. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:154:5: 
  152.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155.   }
  156.   

crypto/mem.c:158:1: start of procedure CRYPTO_zalloc()
    156.   }
    157.   
    158. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    159.   {
    160.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:160:5: 
    158.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    159.   {
    160. >     void *ret = CRYPTO_malloc(num, file, line);
    161.   
    162.       if (ret != NULL)

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
      117.   }
      118.   
      119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      120.   {
      121.       void *ret = NULL;

crypto/mem.c:121:5: 
      119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      120.   {
      121. >     void *ret = NULL;
      122.   
      123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      124.           return malloc_impl(num, file, line);
      125.   

crypto/mem.c:126:9: Taking false branch
      124.           return malloc_impl(num, file, line);
      125.   
      126.       if (num <= 0)
                     ^
      127.           return NULL;
      128.   

crypto/mem.c:129:5: 
      127.           return NULL;
      128.   
      129. >     allow_customize = 0;
      130.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      131.       if (call_malloc_debug) {

crypto/mem.c:139:5: 
      137.       }
      138.   #else
      139. >     osslargused(file); osslargused(line);
      140.       ret = malloc(num);
      141.   #endif

crypto/mem.c:139:24: 
      137.       }
      138.   #else
      139. >     osslargused(file); osslargused(line);
      140.       ret = malloc(num);
      141.   #endif

crypto/mem.c:140:5: 
      138.   #else
      139.       osslargused(file); osslargused(line);
      140. >     ret = malloc(num);
      141.   #endif
      142.   

crypto/mem.c:155:5: 
      153.   #endif
      154.   
      155. >     return ret;
      156.   }
      157.   

crypto/mem.c:156:1: return from a call to CRYPTO_malloc
      154.   
      155.       return ret;
      156. > }
      157.   
      158.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:162:9: Taking true branch
    160.       void *ret = CRYPTO_malloc(num, file, line);
    161.   
    162.       if (ret != NULL)
                   ^
    163.           memset(ret, 0, num);
    164.       return ret;

crypto/mem.c:163:9: 
    161.   
    162.       if (ret != NULL)
    163. >         memset(ret, 0, num);
    164.       return ret;
    165.   }

crypto/mem.c:164:5: 
    162.       if (ret != NULL)
    163.           memset(ret, 0, num);
    164. >     return ret;
    165.   }
    166.   

crypto/mem.c:165:1: return from a call to CRYPTO_zalloc
    163.           memset(ret, 0, num);
    164.       return ret;
    165. > }
    166.   
    167.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:155:1: return from a call to EVP_MD_CTX_new
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155. > }
  156.   
  157.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

crypto/rsa/rsa_oaep.c:247:5: 
245.       unsigned char md[EVP_MAX_MD_SIZE];
246.       int mdlen;
247. >     int rv = -1;
248.   
249.       if (c == NULL)

crypto/rsa/rsa_oaep.c:249:9: Taking false branch
247.       int rv = -1;
248.   
249.       if (c == NULL)
               ^
250.           goto err;
251.       mdlen = EVP_MD_size(dgst);

crypto/rsa/rsa_oaep.c:251:5: 
249.       if (c == NULL)
250.           goto err;
251. >     mdlen = EVP_MD_size(dgst);
252.       if (mdlen < 0)
253.           goto err;

crypto/evp/evp_lib.c:339:1: start of procedure EVP_MD_size()
  337.   }
  338.   
  339. > int EVP_MD_size(const EVP_MD *md)
  340.   {
  341.       if (!md) {

crypto/evp/evp_lib.c:341:10: Taking false branch
  339.   int EVP_MD_size(const EVP_MD *md)
  340.   {
  341.       if (!md) {
                  ^
  342.           EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);
  343.           return -1;

crypto/evp/evp_lib.c:345:5: 
  343.           return -1;
  344.       }
  345. >     return md->md_size;
  346.   }
  347.   

crypto/evp/evp_lib.c:346:1: return from a call to EVP_MD_size
  344.       }
  345.       return md->md_size;
  346. > }
  347.   
  348.   unsigned long EVP_MD_flags(const EVP_MD *md)

crypto/rsa/rsa_oaep.c:252:9: Taking false branch
250.           goto err;
251.       mdlen = EVP_MD_size(dgst);
252.       if (mdlen < 0)
               ^
253.           goto err;
254.       for (i = 0; outlen < len; i++) {

crypto/rsa/rsa_oaep.c:254:10: 
252.       if (mdlen < 0)
253.           goto err;
254. >     for (i = 0; outlen < len; i++) {
255.           cnt[0] = (unsigned char)((i >> 24) & 255);
256.           cnt[1] = (unsigned char)((i >> 16) & 255);

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

crypto/rsa/rsa_oaep.c:255:9: 
253.           goto err;
254.       for (i = 0; outlen < len; i++) {
255. >         cnt[0] = (unsigned char)((i >> 24) & 255);
256.           cnt[1] = (unsigned char)((i >> 16) & 255);
257.           cnt[2] = (unsigned char)((i >> 8)) & 255;

crypto/rsa/rsa_oaep.c:256:9: 
254.       for (i = 0; outlen < len; i++) {
255.           cnt[0] = (unsigned char)((i >> 24) & 255);
256. >         cnt[1] = (unsigned char)((i >> 16) & 255);
257.           cnt[2] = (unsigned char)((i >> 8)) & 255;
258.           cnt[3] = (unsigned char)(i & 255);

crypto/rsa/rsa_oaep.c:257:9: 
255.           cnt[0] = (unsigned char)((i >> 24) & 255);
256.           cnt[1] = (unsigned char)((i >> 16) & 255);
257. >         cnt[2] = (unsigned char)((i >> 8)) & 255;
258.           cnt[3] = (unsigned char)(i & 255);
259.           if (!EVP_DigestInit_ex(c, dgst, NULL)

crypto/rsa/rsa_oaep.c:258:9: 
256.           cnt[1] = (unsigned char)((i >> 16) & 255);
257.           cnt[2] = (unsigned char)((i >> 8)) & 255;
258. >         cnt[3] = (unsigned char)(i & 255);
259.           if (!EVP_DigestInit_ex(c, dgst, NULL)
260.               || !EVP_DigestUpdate(c, seed, seedlen)

crypto/rsa/rsa_oaep.c:259:14: Taking false branch
257.           cnt[2] = (unsigned char)((i >> 8)) & 255;
258.           cnt[3] = (unsigned char)(i & 255);
259.           if (!EVP_DigestInit_ex(c, dgst, NULL)
                    ^
260.               || !EVP_DigestUpdate(c, seed, seedlen)
261.               || !EVP_DigestUpdate(c, cnt, 4))

crypto/rsa/rsa_oaep.c:260:17: 
258.           cnt[3] = (unsigned char)(i & 255);
259.           if (!EVP_DigestInit_ex(c, dgst, NULL)
260. >             || !EVP_DigestUpdate(c, seed, seedlen)
261.               || !EVP_DigestUpdate(c, cnt, 4))
262.               goto err;

crypto/evp/digest.c:254:1: start of procedure EVP_DigestUpdate()
  252.   }
  253.   
  254. > int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
  255.   {
  256.       return ctx->update(ctx, data, count);

crypto/evp/digest.c:256:5: Skipping __function_pointer__(): unresolved function pointer
  254.   int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
  255.   {
  256.       return ctx->update(ctx, data, count);
             ^
  257.   }
  258.   

crypto/evp/digest.c:257:1: return from a call to EVP_DigestUpdate
  255.   {
  256.       return ctx->update(ctx, data, count);
  257. > }
  258.   
  259.   /* The caller can assume that this removes any secret data from the context */

crypto/rsa/rsa_oaep.c:260:17: Taking true branch
258.           cnt[3] = (unsigned char)(i & 255);
259.           if (!EVP_DigestInit_ex(c, dgst, NULL)
260.               || !EVP_DigestUpdate(c, seed, seedlen)
                       ^
261.               || !EVP_DigestUpdate(c, cnt, 4))
262.               goto err;

crypto/rsa/rsa_oaep.c:275:2: 
273.       }
274.       rv = 0;
275. >  err:
276.       EVP_MD_CTX_free(c);
277.       return rv;

crypto/rsa/rsa_oaep.c:276:5: 
274.       rv = 0;
275.    err:
276. >     EVP_MD_CTX_free(c);
277.       return rv;
278.   }

crypto/evp/digest.c:157:1: start of procedure EVP_MD_CTX_free()
  155.   }
  156.   
  157. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  158.   {
  159.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:159:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  157.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  158.   {
  159.       EVP_MD_CTX_reset(ctx);
             ^
  160.       OPENSSL_free(ctx);
  161.   }

crypto/evp/digest.c:160:5: 
  158.   {
  159.       EVP_MD_CTX_reset(ctx);
  160. >     OPENSSL_free(ctx);
  161.   }
  162.   

crypto/mem.c:222:1: start of procedure CRYPTO_free()
    220.   }
    221.   
    222. > void CRYPTO_free(void *str, const char *file, int line)
    223.   {
    224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:224:9: Taking true branch
    222.   void CRYPTO_free(void *str, const char *file, int line)
    223.   {
    224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    225.           free_impl(str, file, line);
    226.           return;

crypto/mem.c:224:30: Taking true branch
    222.   void CRYPTO_free(void *str, const char *file, int line)
    223.   {
    224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    225.           free_impl(str, file, line);
    226.           return;

crypto/mem.c:225:9: Skipping __function_pointer__(): unresolved function pointer
    223.   {
    224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    225.           free_impl(str, file, line);
                   ^
    226.           return;
    227.       }

crypto/mem.c:226:9: 
    224.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    225.           free_impl(str, file, line);
    226. >         return;
    227.       }
    228.   

crypto/mem.c:240:1: return from a call to CRYPTO_free
    238.       free(str);
    239.   #endif
    240. > }
    241.   
    242.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:161:1: return from a call to EVP_MD_CTX_free
  159.       EVP_MD_CTX_reset(ctx);
  160.       OPENSSL_free(ctx);
  161. > }
  162.   
  163.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
