This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: PATCH/RFA free(NULL) bomb in printcmd.c
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: PATCH/RFA free(NULL) bomb in printcmd.c
- From: Daniel Berlin <dan at cgsoftware dot com>
- Date: Mon, 10 Apr 2000 20:17:23 -0700 (PDT)
- cc: Philippe De Muyter <phdm at macqel dot be>, "gdb-patches at sourceware dot cygnus dot com" <gdb-patches at sourceware dot cygnus dot com>
Yeah.
it would.
Then again, i dmallocified GDB about a week and a half ago (which was
quite a chore, involving dmallocifying libiberty, etc. I got literally
every call), and i stopped fixing null pointer frees after about 35th one.
So he's really going to be fighting an uphill battle.
--Dan
On Tue, 11 Apr 2000, Andrew Cagney wrote:
> Philippe De Muyter wrote:
> >
> > printcmd.c contains hidden calls to free(NULL), that can crash on many OS'es;
> > they are constructed by make_cleanup (free, name) calls, where `name' has
> > the value NULL.
>
> > - struct cleanup *cleanup_chain = make_cleanup (free, name);
> > + struct cleanup *cleanup_chain = make_cleanup (null_cleanup, name);
> > if (print_symbol_filename)
> > - make_cleanup (free, filename);
> > + make_cleanup (null_cleanup, filename);
>
> Um, I'm confused. wouldn't it be easier to just delete the two cleanup
> calls (the first, perhaphs, replaced with make_cleanup (null_cleanup,
> NULL))?
>
> Andrew
>