crypto/evp/evp_pbe.c:226: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_malloc()` at line 217, column 20 is not reachable after line 226, column 5.
Showing all 40 steps of the trace


crypto/evp/evp_pbe.c:206:1: start of procedure EVP_PBE_alg_add_type()
204.   /* Add a PBE algorithm */
205.   
206. > int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid,
207.                            int md_nid, EVP_PBE_KEYGEN *keygen)
208.   {

crypto/evp/evp_pbe.c:211:9: Taking false branch
209.       EVP_PBE_CTL *pbe_tmp;
210.   
211.       if (pbe_algs == NULL) {
               ^
212.           pbe_algs = sk_EVP_PBE_CTL_new(pbe_cmp);
213.           if (pbe_algs == NULL)

crypto/evp/evp_pbe.c:217:9: 
215.       }
216.   
217. >     if ((pbe_tmp = OPENSSL_malloc(sizeof(*pbe_tmp))) == NULL)
218.           goto err;
219.   

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.   #ifndef OPENSSL_NO_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/evp/evp_pbe.c:217:9: Taking false branch
215.       }
216.   
217.       if ((pbe_tmp = OPENSSL_malloc(sizeof(*pbe_tmp))) == NULL)
               ^
218.           goto err;
219.   

crypto/evp/evp_pbe.c:220:5: 
218.           goto err;
219.   
220. >     pbe_tmp->pbe_type = pbe_type;
221.       pbe_tmp->pbe_nid = pbe_nid;
222.       pbe_tmp->cipher_nid = cipher_nid;

crypto/evp/evp_pbe.c:221:5: 
219.   
220.       pbe_tmp->pbe_type = pbe_type;
221. >     pbe_tmp->pbe_nid = pbe_nid;
222.       pbe_tmp->cipher_nid = cipher_nid;
223.       pbe_tmp->md_nid = md_nid;

crypto/evp/evp_pbe.c:222:5: 
220.       pbe_tmp->pbe_type = pbe_type;
221.       pbe_tmp->pbe_nid = pbe_nid;
222. >     pbe_tmp->cipher_nid = cipher_nid;
223.       pbe_tmp->md_nid = md_nid;
224.       pbe_tmp->keygen = keygen;

crypto/evp/evp_pbe.c:223:5: 
221.       pbe_tmp->pbe_nid = pbe_nid;
222.       pbe_tmp->cipher_nid = cipher_nid;
223. >     pbe_tmp->md_nid = md_nid;
224.       pbe_tmp->keygen = keygen;
225.   

crypto/evp/evp_pbe.c:224:5: 
222.       pbe_tmp->cipher_nid = cipher_nid;
223.       pbe_tmp->md_nid = md_nid;
224. >     pbe_tmp->keygen = keygen;
225.   
226.       sk_EVP_PBE_CTL_push(pbe_algs, pbe_tmp);

crypto/evp/evp_pbe.c:226:5: 
224.       pbe_tmp->keygen = keygen;
225.   
226. >     sk_EVP_PBE_CTL_push(pbe_algs, pbe_tmp);
227.       return 1;
228.   

crypto/evp/evp_locl.h:300:1: start of procedure sk_EVP_PBE_CTL_push()
  298.   
  299.   typedef struct evp_pbe_st EVP_PBE_CTL;
  300. > DEFINE_STACK_OF(EVP_PBE_CTL)

crypto/stack/stack.c:259:1: start of procedure sk_push()
    257.   }
    258.   
    259. > int sk_push(_STACK *st, void *data)
    260.   {
    261.       return (sk_insert(st, data, st->num));

crypto/stack/stack.c:261:5: 
    259.   int sk_push(_STACK *st, void *data)
    260.   {
    261. >     return (sk_insert(st, data, st->num));
    262.   }
    263.   

crypto/stack/stack.c:167:1: start of procedure sk_insert()
      165.   }
      166.   
      167. > int sk_insert(_STACK *st, void *data, int loc)
      168.   {
      169.       char **s;

crypto/stack/stack.c:171:9: Taking false branch
      169.       char **s;
      170.   
      171.       if (st == NULL)
                     ^
      172.           return 0;
      173.       if (st->num_alloc <= st->num + 1) {

crypto/stack/stack.c:173:9: Taking true branch
      171.       if (st == NULL)
      172.           return 0;
      173.       if (st->num_alloc <= st->num + 1) {
                     ^
      174.           s = OPENSSL_realloc((char *)st->data,
      175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);

crypto/stack/stack.c:174:9: 
      172.           return 0;
      173.       if (st->num_alloc <= st->num + 1) {
      174. >         s = OPENSSL_realloc((char *)st->data,
      175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);
      176.           if (s == NULL)

crypto/mem.c:166:1: start of procedure CRYPTO_realloc()
        164.   }
        165.   
        166. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
        167.   {
        168.       if (str == NULL)

crypto/mem.c:168:9: Taking true branch
        166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
        167.   {
        168.       if (str == NULL)
                       ^
        169.           return CRYPTO_malloc(num, file, line);
        170.   

crypto/mem.c:169:9: 
        167.   {
        168.       if (str == NULL)
        169. >         return CRYPTO_malloc(num, file, line);
        170.   
        171.       if (num == 0) {

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 true branch
          122.       void *ret = NULL;
          123.   
          124.       if (num <= 0)
                         ^
          125.           return NULL;
          126.   

crypto/mem.c:125:9: 
          123.   
          124.       if (num <= 0)
          125. >         return NULL;
          126.   
          127.       allow_customize = 0;

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:191:1: return from a call to CRYPTO_realloc
        189.       return realloc(str, num);
        190.   
        191. > }
        192.   
        193.   void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,

crypto/stack/stack.c:176:13: Taking true branch
      174.           s = OPENSSL_realloc((char *)st->data,
      175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);
      176.           if (s == NULL)
                         ^
      177.               return (0);
      178.           st->data = s;

crypto/stack/stack.c:177:13: 
      175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);
      176.           if (s == NULL)
      177. >             return (0);
      178.           st->data = s;
      179.           st->num_alloc *= 2;

crypto/stack/stack.c:191:1: return from a call to sk_insert
      189.       st->sorted = 0;
      190.       return (st->num);
      191. > }
      192.   
      193.   void *sk_delete_ptr(_STACK *st, void *p)

crypto/stack/stack.c:262:1: return from a call to sk_push
    260.   {
    261.       return (sk_insert(st, data, st->num));
    262. > }
    263.   
    264.   int sk_unshift(_STACK *st, void *data)

crypto/evp/evp_locl.h:300:1: return from a call to sk_EVP_PBE_CTL_push
  298.   
  299.   typedef struct evp_pbe_st EVP_PBE_CTL;
  300. > DEFINE_STACK_OF(EVP_PBE_CTL)
