This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Simple but crucial bug fix to gdb
- To: Daniel Berlin <dan at cgsoftware dot com>
- Subject: Re: Simple but crucial bug fix to gdb
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Date: 01 Jun 2001 16:16:09 -0500
- Cc: Jim Blandy <jimb at zwingli dot cygnus dot com>,Charlie Mills <cmills at synopsys dot com>,gdb-patches at sourceware dot cygnus dot com
- References: <3.0.5.32.20010530142745.01470ec0@pophost.pdxuxbre.lmc.com><npofs8kkel.fsf@zwingli.cygnus.com><87hexzaozu.fsf@dynamic-addr-83-177.resnet.rochester.edu>
Daniel Berlin <dan@cgsoftware.com> writes:
> > case 'f':
> > + if (! pst)
> > + {
> > + int name_len = p - namestring;
> > + char *name = xmalloc (name_len + 1);
> > + memcpy (name, namestring, name_len);
> > + name[name_len] = '\0';
> > + complain (&function_outside_compilation_unit, name);
>
> Err, isn't this a memory leak?
>
> You never free the name after complaining.
>
> Same below
Arf! Thanks!