crypto/objects/o_names.c:185: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_malloc()` at line 174, column 11 is not reachable after line 185, column 5.
Showing all 32 steps of the trace


crypto/objects/o_names.c:163:1: start of procedure OBJ_NAME_add()
161.   }
162.   
163. > int OBJ_NAME_add(const char *name, int type, const char *data)
164.   {
165.       OBJ_NAME *onp, *ret;

crypto/objects/o_names.c:168:10: Taking false branch
166.       int alias;
167.   
168.       if ((names_lh == NULL) && !OBJ_NAME_init())
                ^
169.           return (0);
170.   

crypto/objects/o_names.c:171:5: 
169.           return (0);
170.   
171. >     alias = type & OBJ_NAME_ALIAS;
172.       type &= ~OBJ_NAME_ALIAS;
173.   

crypto/objects/o_names.c:172:5: 
170.   
171.       alias = type & OBJ_NAME_ALIAS;
172. >     type &= ~OBJ_NAME_ALIAS;
173.   
174.       onp = OPENSSL_malloc(sizeof(*onp));

crypto/objects/o_names.c:174:5: 
172.       type &= ~OBJ_NAME_ALIAS;
173.   
174. >     onp = OPENSSL_malloc(sizeof(*onp));
175.       if (onp == NULL) {
176.           /* ERROR */

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/objects/o_names.c:175:9: Taking false branch
173.   
174.       onp = OPENSSL_malloc(sizeof(*onp));
175.       if (onp == NULL) {
               ^
176.           /* ERROR */
177.           return (0);

crypto/objects/o_names.c:180:5: 
178.       }
179.   
180. >     onp->name = name;
181.       onp->alias = alias;
182.       onp->type = type;

crypto/objects/o_names.c:181:5: 
179.   
180.       onp->name = name;
181. >     onp->alias = alias;
182.       onp->type = type;
183.       onp->data = data;

crypto/objects/o_names.c:182:5: 
180.       onp->name = name;
181.       onp->alias = alias;
182. >     onp->type = type;
183.       onp->data = data;
184.   

crypto/objects/o_names.c:183:5: 
181.       onp->alias = alias;
182.       onp->type = type;
183. >     onp->data = data;
184.   
185.       ret = lh_OBJ_NAME_insert(names_lh, onp);

crypto/objects/o_names.c:185:5: 
183.       onp->data = data;
184.   
185. >     ret = lh_OBJ_NAME_insert(names_lh, onp);
186.       if (ret != NULL) {
187.           /* free things */

crypto/objects/obj_lcl.h:5:1: start of procedure lh_OBJ_NAME_insert()
  3.   typedef struct name_funcs_st NAME_FUNCS;
  4.   DEFINE_STACK_OF(NAME_FUNCS)
  5. > DEFINE_LHASH_OF(OBJ_NAME);
  6.   typedef struct added_obj_st ADDED_OBJ;
  7.   DEFINE_LHASH_OF(ADDED_OBJ);

crypto/lhash/lhash.c:156:1: start of procedure lh_insert()
    154.   }
    155.   
    156. > void *lh_insert(_LHASH *lh, void *data)
    157.   {
    158.       unsigned long hash;

crypto/lhash/lhash.c:162:5: 
    160.       void *ret;
    161.   
    162. >     lh->error = 0;
    163.       if (lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))
    164.           expand(lh);

crypto/lhash/lhash.c:163:9: Taking false branch
    161.   
    162.       lh->error = 0;
    163.       if (lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))
                   ^
    164.           expand(lh);
    165.   

crypto/lhash/lhash.c:166:5: Skipping getrn(): empty list of specs
    164.           expand(lh);
    165.   
    166.       rn = getrn(lh, data, &hash);
               ^
    167.   
    168.       if (*rn == NULL) {

crypto/lhash/lhash.c:168:9: Taking false branch
    166.       rn = getrn(lh, data, &hash);
    167.   
    168.       if (*rn == NULL) {
                   ^
    169.           if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
    170.               lh->error++;

crypto/lhash/lhash.c:182:9: 
    180.       } else {                    /* replace same key */
    181.   
    182. >         ret = (*rn)->data;
    183.           (*rn)->data = data;
    184.           lh->num_replace++;

crypto/lhash/lhash.c:183:9: 
    181.   
    182.           ret = (*rn)->data;
    183. >         (*rn)->data = data;
    184.           lh->num_replace++;
    185.       }

crypto/lhash/lhash.c:184:9: 
    182.           ret = (*rn)->data;
    183.           (*rn)->data = data;
    184. >         lh->num_replace++;
    185.       }
    186.       return (ret);

crypto/lhash/lhash.c:186:5: 
    184.           lh->num_replace++;
    185.       }
    186. >     return (ret);
    187.   }
    188.   

crypto/lhash/lhash.c:187:1: return from a call to lh_insert
    185.       }
    186.       return (ret);
    187. > }
    188.   
    189.   void *lh_delete(_LHASH *lh, const void *data)

crypto/objects/obj_lcl.h:5:1: return from a call to lh_OBJ_NAME_insert
  3.   typedef struct name_funcs_st NAME_FUNCS;
  4.   DEFINE_STACK_OF(NAME_FUNCS)
  5. > DEFINE_LHASH_OF(OBJ_NAME);
  6.   typedef struct added_obj_st ADDED_OBJ;
  7.   DEFINE_LHASH_OF(ADDED_OBJ);
