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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

crypto/pkcs12/p12_key.c:119:9: Taking false branch
117.   
118.       ctx = EVP_MD_CTX_new();
119.       if (ctx == NULL)
               ^
120.           goto err;
121.   

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

crypto/evp/evp_lib.c:285:1: start of procedure EVP_MD_block_size()
  283.   }
  284.   
  285. > int EVP_MD_block_size(const EVP_MD *md)
  286.   {
  287.       return md->block_size;

crypto/evp/evp_lib.c:287:5: 
  285.   int EVP_MD_block_size(const EVP_MD *md)
  286.   {
  287. >     return md->block_size;
  288.   }
  289.   

crypto/evp/evp_lib.c:288:1: return from a call to EVP_MD_block_size
  286.   {
  287.       return md->block_size;
  288. > }
  289.   
  290.   int EVP_MD_type(const EVP_MD *md)

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

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

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

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

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

crypto/pkcs12/p12_key.c:132:9: Taking true branch
130.       v = EVP_MD_block_size(md_type);
131.       u = EVP_MD_size(md_type);
132.       if (u < 0)
               ^
133.           return 0;
134.       D = OPENSSL_malloc(v);

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