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


crypto/objects/o_names.c:186:1: start of procedure OBJ_NAME_add()
184.   }
185.   
186. > int OBJ_NAME_add(const char *name, int type, const char *data)
187.   {
188.       OBJ_NAME *onp, *ret;

crypto/objects/o_names.c:191:10: Taking true branch
189.       int alias;
190.   
191.       if ((names_lh == NULL) && !OBJ_NAME_init())
                ^
192.           return (0);
193.   

crypto/objects/o_names.c:191:32: 
189.       int alias;
190.   
191. >     if ((names_lh == NULL) && !OBJ_NAME_init())
192.           return (0);
193.   

crypto/objects/o_names.c:65:1: start of procedure OBJ_NAME_init()
  63.   static int obj_name_cmp(const OBJ_NAME *a, const OBJ_NAME *b);
  64.   
  65. > int OBJ_NAME_init(void)
  66.   {
  67.       if (names_lh != NULL)

crypto/objects/o_names.c:67:9: Taking false branch
  65.   int OBJ_NAME_init(void)
  66.   {
  67.       if (names_lh != NULL)
                ^
  68.           return (1);
  69.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);

crypto/objects/o_names.c:69:5: 
  67.       if (names_lh != NULL)
  68.           return (1);
  69. >     CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
  70.       names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
  71.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);

crypto/mem_dbg.c:108:1: start of procedure CRYPTO_mem_ctrl()
    106.   #endif
    107.   
    108. > int CRYPTO_mem_ctrl(int mode)
    109.   {
    110.   #ifdef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem_dbg.c:111:5: 
    109.   {
    110.   #ifdef OPENSSL_NO_CRYPTO_MDEBUG
    111. >     return mode - mode;
    112.   #else
    113.       int ret = mh_mode;

crypto/mem_dbg.c:178:1: return from a call to CRYPTO_mem_ctrl
    176.       return (ret);
    177.   #endif
    178. > }
    179.   
    180.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/objects/o_names.c:70:5: 
  68.           return (1);
  69.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
  70. >     names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
  71.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
  72.       return (names_lh != NULL);

crypto/objects/obj_lcl.h:12:1: start of procedure lh_OBJ_NAME_new()
    10.   typedef struct name_funcs_st NAME_FUNCS;
    11.   DEFINE_STACK_OF(NAME_FUNCS)
    12. > DEFINE_LHASH_OF(OBJ_NAME);
    13.   typedef struct added_obj_st ADDED_OBJ;
    14.   DEFINE_LHASH_OF(ADDED_OBJ);

crypto/objects/obj_lcl.h:12:1: return from a call to lh_OBJ_NAME_new
    10.   typedef struct name_funcs_st NAME_FUNCS;
    11.   DEFINE_STACK_OF(NAME_FUNCS)
    12. > DEFINE_LHASH_OF(OBJ_NAME);
    13.   typedef struct added_obj_st ADDED_OBJ;
    14.   DEFINE_LHASH_OF(ADDED_OBJ);

crypto/objects/o_names.c:71:5: 
  69.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
  70.       names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
  71. >     CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
  72.       return (names_lh != NULL);
  73.   }

crypto/mem_dbg.c:108:1: start of procedure CRYPTO_mem_ctrl()
    106.   #endif
    107.   
    108. > int CRYPTO_mem_ctrl(int mode)
    109.   {
    110.   #ifdef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem_dbg.c:111:5: 
    109.   {
    110.   #ifdef OPENSSL_NO_CRYPTO_MDEBUG
    111. >     return mode - mode;
    112.   #else
    113.       int ret = mh_mode;

crypto/mem_dbg.c:178:1: return from a call to CRYPTO_mem_ctrl
    176.       return (ret);
    177.   #endif
    178. > }
    179.   
    180.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/objects/o_names.c:72:13: Condition is true
  70.       names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
  71.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
  72.       return (names_lh != NULL);
                    ^
  73.   }
  74.   

crypto/objects/o_names.c:72:5: 
  70.       names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
  71.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
  72. >     return (names_lh != NULL);
  73.   }
  74.   

crypto/objects/o_names.c:73:1: return from a call to OBJ_NAME_init
  71.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
  72.       return (names_lh != NULL);
  73. > }
  74.   
  75.   int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),

crypto/objects/o_names.c:191:32: Taking false branch
189.       int alias;
190.   
191.       if ((names_lh == NULL) && !OBJ_NAME_init())
                                      ^
192.           return (0);
193.   

crypto/objects/o_names.c:194:5: 
192.           return (0);
193.   
194. >     alias = type & OBJ_NAME_ALIAS;
195.       type &= ~OBJ_NAME_ALIAS;
196.   

crypto/objects/o_names.c:195:5: 
193.   
194.       alias = type & OBJ_NAME_ALIAS;
195. >     type &= ~OBJ_NAME_ALIAS;
196.   
197.       onp = OPENSSL_malloc(sizeof(*onp));

crypto/objects/o_names.c:197:5: 
195.       type &= ~OBJ_NAME_ALIAS;
196.   
197. >     onp = OPENSSL_malloc(sizeof(*onp));
198.       if (onp == NULL) {
199.           /* ERROR */

crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
  69.   }
  70.   
  71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  72.   {
  73.       void *ret = NULL;

crypto/mem.c:73:5: 
  71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  72.   {
  73. >     void *ret = NULL;
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
  73.       void *ret = NULL;
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                ^
  76.           return malloc_impl(num, file, line);
  77.   

crypto/mem.c:78:9: Taking false branch
  76.           return malloc_impl(num, file, line);
  77.   
  78.       if (num <= 0)
                ^
  79.           return NULL;
  80.   

crypto/mem.c:81:5: 
  79.           return NULL;
  80.   
  81. >     allow_customize = 0;
  82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
  89.       }
  90.   #else
  91. >     osslargused(file); osslargused(line);
  92.       ret = malloc(num);
  93.   #endif

crypto/mem.c:91:24: 
  89.       }
  90.   #else
  91. >     osslargused(file); osslargused(line);
  92.       ret = malloc(num);
  93.   #endif

crypto/mem.c:92:5: 
  90.   #else
  91.       osslargused(file); osslargused(line);
  92. >     ret = malloc(num);
  93.   #endif
  94.   

crypto/mem.c:95:5: 
  93.   #endif
  94.   
  95. >     return ret;
  96.   }
  97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
  94.   
  95.       return ret;
  96. > }
  97.   
  98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/objects/o_names.c:198:9: Taking false branch
196.   
197.       onp = OPENSSL_malloc(sizeof(*onp));
198.       if (onp == NULL) {
               ^
199.           /* ERROR */
200.           return 0;

crypto/objects/o_names.c:203:5: 
201.       }
202.   
203. >     onp->name = name;
204.       onp->alias = alias;
205.       onp->type = type;

crypto/objects/o_names.c:204:5: 
202.   
203.       onp->name = name;
204. >     onp->alias = alias;
205.       onp->type = type;
206.       onp->data = data;

crypto/objects/o_names.c:205:5: 
203.       onp->name = name;
204.       onp->alias = alias;
205. >     onp->type = type;
206.       onp->data = data;
207.   

crypto/objects/o_names.c:206:5: 
204.       onp->alias = alias;
205.       onp->type = type;
206. >     onp->data = data;
207.   
208.       ret = lh_OBJ_NAME_insert(names_lh, onp);

crypto/objects/o_names.c:208:5: 
206.       onp->data = data;
207.   
208. >     ret = lh_OBJ_NAME_insert(names_lh, onp);
209.       if (ret != NULL) {
210.           /* free things */

crypto/objects/obj_lcl.h:12:1: start of procedure lh_OBJ_NAME_insert()
  10.   typedef struct name_funcs_st NAME_FUNCS;
  11.   DEFINE_STACK_OF(NAME_FUNCS)
  12. > DEFINE_LHASH_OF(OBJ_NAME);
  13.   typedef struct added_obj_st ADDED_OBJ;
  14.   DEFINE_LHASH_OF(ADDED_OBJ);

crypto/lhash/lhash.c:70:1: start of procedure OPENSSL_LH_insert()
    68.   }
    69.   
    70. > void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data)
    71.   {
    72.       unsigned long hash;

crypto/lhash/lhash.c:76:5: 
    74.       void *ret;
    75.   
    76. >     lh->error = 0;
    77.       if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
    78.           return NULL;        /* 'lh->error++' already done in 'expand' */

crypto/lhash/lhash.c:77:10: Taking false branch
    75.   
    76.       lh->error = 0;
    77.       if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
                   ^
    78.           return NULL;        /* 'lh->error++' already done in 'expand' */
    79.   

crypto/lhash/lhash.c:80:5: Skipping getrn(): empty list of specs
    78.           return NULL;        /* 'lh->error++' already done in 'expand' */
    79.   
    80.       rn = getrn(lh, data, &hash);
              ^
    81.   
    82.       if (*rn == NULL) {

crypto/lhash/lhash.c:82:9: Taking false branch
    80.       rn = getrn(lh, data, &hash);
    81.   
    82.       if (*rn == NULL) {
                  ^
    83.           if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
    84.               lh->error++;

crypto/lhash/lhash.c:96:9: 
    94.       } else {                    /* replace same key */
    95.   
    96. >         ret = (*rn)->data;
    97.           (*rn)->data = data;
    98.           lh->num_replace++;

crypto/lhash/lhash.c:97:9: 
    95.   
    96.           ret = (*rn)->data;
    97. >         (*rn)->data = data;
    98.           lh->num_replace++;
    99.       }

crypto/lhash/lhash.c:98:9: 
    96.           ret = (*rn)->data;
    97.           (*rn)->data = data;
    98. >         lh->num_replace++;
    99.       }
    100.       return (ret);

crypto/lhash/lhash.c:100:5: 
    98.           lh->num_replace++;
    99.       }
    100. >     return (ret);
    101.   }
    102.   

crypto/lhash/lhash.c:101:1: return from a call to OPENSSL_LH_insert
    99.       }
    100.       return (ret);
    101. > }
    102.   
    103.   void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)

crypto/objects/obj_lcl.h:12:1: return from a call to lh_OBJ_NAME_insert
  10.   typedef struct name_funcs_st NAME_FUNCS;
  11.   DEFINE_STACK_OF(NAME_FUNCS)
  12. > DEFINE_LHASH_OF(OBJ_NAME);
  13.   typedef struct added_obj_st ADDED_OBJ;
  14.   DEFINE_LHASH_OF(ADDED_OBJ);

crypto/objects/o_names.c:209:9: Taking true branch
207.   
208.       ret = lh_OBJ_NAME_insert(names_lh, onp);
209.       if (ret != NULL) {
               ^
210.           /* free things */
211.           if ((name_funcs_stack != NULL)

crypto/objects/o_names.c:211:14: 
209.       if (ret != NULL) {
210.           /* free things */
211. >         if ((name_funcs_stack != NULL)
212.               && (sk_NAME_FUNCS_num(name_funcs_stack) > ret->type)) {
213.               /*
