This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Memory leak in bt-load.c ?


Hi,

in file 'bt-load.c', in function 'augment_live_range', some memory is
xmalloc'ed. It seems to be possible to never free it, if all the first tests
are true.

Yhe memory is only freed once at the end of the function.

CJ


=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
=+

augment_live_range (bitmap live_range, HARD_REG_SET *btrs_live_in_range,
      basic_block head_bb, basic_block new_bb, int full_range)
{
  basic_block *worklist, *tos;

  tos = worklist = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));

  if (dominated_by_p (CDI_DOMINATORS, new_bb, head_bb))
    {
      if (new_bb == head_bb)
      {
[...]
        return;        <------------------------------ *worklist is not
freed !*
      }
      *tos++ = new_bb;
    }
  else
    {
    }
[...]
  free (worklist);
}





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]