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


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]