crypto/pkcs12/p12_key.c:132: error: MEMORY_LEAK
  memory dynamically allocated to `return` by call to `EVP_MD_CTX_new()` at line 117, column 11 is not reachable after line 132, column 9.
Showing all 36 steps of the trace


crypto/pkcs12/p12_key.c:102:1: start of procedure PKCS12_key_gen_uni()
100.   }
101.   
102. > int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
103.                          int saltlen, int id, int iter, int n,
104.                          unsigned char *out, const EVP_MD *md_type)

crypto/pkcs12/p12_key.c:106:5: 
104.                          unsigned char *out, const EVP_MD *md_type)
105.   {
106. >     unsigned char *B = NULL, *D = NULL, *I = NULL, *p = NULL, *Ai = NULL;
107.       int Slen, Plen, Ilen, Ijlen;
108.       int i, j, u, v;

crypto/pkcs12/p12_key.c:109:5: 
107.       int Slen, Plen, Ilen, Ijlen;
108.       int i, j, u, v;
109. >     int ret = 0;
110.       BIGNUM *Ij = NULL, *Bpl1 = NULL; /* These hold Ij and B + 1 */
111.       EVP_MD_CTX *ctx = NULL;

crypto/pkcs12/p12_key.c:110:5: 
108.       int i, j, u, v;
109.       int ret = 0;
110. >     BIGNUM *Ij = NULL, *Bpl1 = NULL; /* These hold Ij and B + 1 */
111.       EVP_MD_CTX *ctx = NULL;
112.   #ifdef  DEBUG_KEYGEN

crypto/pkcs12/p12_key.c:111:5: 
109.       int ret = 0;
110.       BIGNUM *Ij = NULL, *Bpl1 = NULL; /* These hold Ij and B + 1 */
111. >     EVP_MD_CTX *ctx = NULL;
112.   #ifdef  DEBUG_KEYGEN
113.       unsigned char *tmpout = out;

crypto/pkcs12/p12_key.c:117:5: 
115.   #endif
116.   
117. >     ctx = EVP_MD_CTX_new();
118.       if (ctx == NULL)
119.           goto err;

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:156:1: start of procedure CRYPTO_zalloc()
    154.   }
    155.   
    156. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    157.   {
    158.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:158:5: 
    156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    157.   {
    158. >     void *ret = CRYPTO_malloc(num, file, line);
    159.   
    160.       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 (num <= 0)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (num <= 0)
                     ^
      124.           return NULL;
      125.   

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

crypto/mem.c:136:5: 
      134.       }
      135.   #else
      136. >     (void)file;
      137.       (void)line;
      138.       ret = malloc(num);

crypto/mem.c:137:5: 
      135.   #else
      136.       (void)file;
      137. >     (void)line;
      138.       ret = malloc(num);
      139.   #endif

crypto/mem.c:138:5: 
      136.       (void)file;
      137.       (void)line;
      138. >     ret = malloc(num);
      139.   #endif
      140.   

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

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

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

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

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

crypto/mem.c:163:1: return from a call to CRYPTO_zalloc
    161.           memset(ret, 0, num);
    162.       return ret;
    163. > }
    164.   
    165.   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/pkcs12/p12_key.c:118:9: Taking false branch
116.   
117.       ctx = EVP_MD_CTX_new();
118.       if (ctx == NULL)
               ^
119.           goto err;
120.   

crypto/pkcs12/p12_key.c:129:5: 
127.       h__dump(salt, saltlen);
128.   #endif
129. >     v = EVP_MD_block_size(md_type);
130.       u = EVP_MD_size(md_type);
131.       if (u < 0)

crypto/evp/evp_lib.c:324:1: start of procedure EVP_MD_block_size()
  322.   }
  323.   
  324. > int EVP_MD_block_size(const EVP_MD *md)
  325.   {
  326.       return md->block_size;

crypto/evp/evp_lib.c:326:5: 
  324.   int EVP_MD_block_size(const EVP_MD *md)
  325.   {
  326. >     return md->block_size;
  327.   }
  328.   

crypto/evp/evp_lib.c:327:1: return from a call to EVP_MD_block_size
  325.   {
  326.       return md->block_size;
  327. > }
  328.   
  329.   int EVP_MD_type(const EVP_MD *md)

crypto/pkcs12/p12_key.c:130:5: 
128.   #endif
129.       v = EVP_MD_block_size(md_type);
130. >     u = EVP_MD_size(md_type);
131.       if (u < 0)
132.           return 0;

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/pkcs12/p12_key.c:131:9: Taking true branch
129.       v = EVP_MD_block_size(md_type);
130.       u = EVP_MD_size(md_type);
131.       if (u < 0)
               ^
132.           return 0;
133.       D = OPENSSL_malloc(v);

crypto/pkcs12/p12_key.c:132:9: 
130.       u = EVP_MD_size(md_type);
131.       if (u < 0)
132. >         return 0;
133.       D = OPENSSL_malloc(v);
134.       Ai = OPENSSL_malloc(u);
