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 51 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 true branch
166.       int alias;
167.   
168.       if ((names_lh == NULL) && !OBJ_NAME_init())
                ^
169.           return (0);
170.   

crypto/objects/o_names.c:168:32: 
166.       int alias;
167.   
168. >     if ((names_lh == NULL) && !OBJ_NAME_init())
169.           return (0);
170.   

crypto/objects/o_names.c:48:1: start of procedure OBJ_NAME_init()
  46.   static int obj_name_cmp(const OBJ_NAME *a, const OBJ_NAME *b);
  47.   
  48. > int OBJ_NAME_init(void)
  49.   {
  50.       if (names_lh != NULL)

crypto/objects/o_names.c:50:9: Taking false branch
  48.   int OBJ_NAME_init(void)
  49.   {
  50.       if (names_lh != NULL)
                ^
  51.           return (1);
  52.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);

crypto/objects/o_names.c:52:5: 
  50.       if (names_lh != NULL)
  51.           return (1);
  52. >     CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
  53.       names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
  54.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);

crypto/mem_dbg.c:204:1: start of procedure CRYPTO_mem_ctrl()
    202.   #endif
    203.   
    204. > int CRYPTO_mem_ctrl(int mode)
    205.   {
    206.   #ifdef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem_dbg.c:207:5: 
    205.   {
    206.   #ifdef OPENSSL_NO_CRYPTO_MDEBUG
    207. >     return mode - mode;
    208.   #else
    209.       int ret = mh_mode;

crypto/mem_dbg.c:273:1: return from a call to CRYPTO_mem_ctrl
    271.       return (ret);
    272.   #endif
    273. > }
    274.   
    275.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/objects/o_names.c:53:5: 
  51.           return (1);
  52.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
  53. >     names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
  54.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
  55.       return (names_lh != NULL);

crypto/objects/obj_lcl.h:5:1: start of procedure lh_OBJ_NAME_new()
    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/objects/obj_lcl.h:5:1: return from a call to lh_OBJ_NAME_new
    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/objects/o_names.c:54:5: 
  52.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
  53.       names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
  54. >     CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
  55.       return (names_lh != NULL);
  56.   }

crypto/mem_dbg.c:204:1: start of procedure CRYPTO_mem_ctrl()
    202.   #endif
    203.   
    204. > int CRYPTO_mem_ctrl(int mode)
    205.   {
    206.   #ifdef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem_dbg.c:207:5: 
    205.   {
    206.   #ifdef OPENSSL_NO_CRYPTO_MDEBUG
    207. >     return mode - mode;
    208.   #else
    209.       int ret = mh_mode;

crypto/mem_dbg.c:273:1: return from a call to CRYPTO_mem_ctrl
    271.       return (ret);
    272.   #endif
    273. > }
    274.   
    275.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/objects/o_names.c:55:13: Condition is true
  53.       names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
  54.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
  55.       return (names_lh != NULL);
                    ^
  56.   }
  57.   

crypto/objects/o_names.c:55:5: 
  53.       names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
  54.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
  55. >     return (names_lh != NULL);
  56.   }
  57.   

crypto/objects/o_names.c:56:1: return from a call to OBJ_NAME_init
  54.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
  55.       return (names_lh != NULL);
  56. > }
  57.   
  58.   int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),

crypto/objects/o_names.c:168:32: 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: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. >     (void)file;
  140.       (void)line;
  141.       ret = malloc(num);

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

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

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

crypto/mem.c:157:1: return from a call to CRYPTO_malloc
  155.   
  156.       return ret;
  157. > }
  158.   
  159.   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:155:1: start of procedure lh_insert()
    153.   }
    154.   
    155. > void *lh_insert(_LHASH *lh, void *data)
    156.   {
    157.       unsigned long hash;

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

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

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

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

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

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

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

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

crypto/lhash/lhash.c:186:1: return from a call to lh_insert
    184.       }
    185.       return (ret);
    186. > }
    187.   
    188.   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);
