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: ac131313 at cygnus dot com (Andrew Cagney)
- Subject: Re: PATCH/RFA free(NULL) bomb in printcmd.c
- From: "Philippe De Muyter" <phdm at macqel dot be>
- Date: Mon, 24 Apr 2000 06:38:45 +0200 (CEST)
- Cc: gdb-patches at sourceware dot cygnus dot com
Andrew Cagney wrote :
> The attached appears to work much better. The function wasn't cleaning
> up when build_address_symbolic failed. This led to a later cleanup call
> freeing a garbage pointer on the stack.
>
> Philippe, can you try it on your platform.
>
> Andrew
> Thu Apr 20 17:39:11 2000 Andrew Cagney <cagney@b1.cygnus.com>
>
> * defs.h, utils.c (free_current_contents): Change parameter to
> void*.
>
> From Philippe De Muyter <phdm@macqel.be>:
> * printcmd.c (print_address_symbolic): Call `make_cleanup' with
> `(free_current_contents, &x)', not `(free, x)'.
> * utils.c (free_current_contents): Do not `free (NULL)'.
>
> * printcmd.c (print_address_symbolic): Cleanup after a failed
> call to build_address_symbolic.
>
I've tested it, and it's fine. Thanks.
Philippe