This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Memory leak in bt-load.c ?
- From: "Christophe Jaillet" <christophe dot jaillet at wanadoo dot fr>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 8 Jan 2006 21:34:11 +0100
- Subject: 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);
}