This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


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

Re: PATCH/RFA free(NULL) bomb in printcmd.c


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
> 


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