Simple but crucial bug fix to gdb

Jim Blandy jimb@zwingli.cygnus.com
Fri Jun 1 14:15:00 GMT 2001


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!



More information about the Gdb-patches mailing list