diff options
author | Andrew Cagney <cagney@redhat.com> | 2000-04-21 04:10:18 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2000-04-21 04:10:18 +0000 |
commit | 2f9429aea399b8ff5c1d2d8f7dd0b5e14202f1e8 (patch) | |
tree | b79970c8cd4311360bd46b55935949224f31e326 /gdb/utils.c | |
parent | 61c37cee5da9d08b107ec331b1080f1982f5afa1 (diff) | |
download | gdb-2f9429aea399b8ff5c1d2d8f7dd0b5e14202f1e8.zip gdb-2f9429aea399b8ff5c1d2d8f7dd0b5e14202f1e8.tar.gz gdb-2f9429aea399b8ff5c1d2d8f7dd0b5e14202f1e8.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r-- | gdb/utils.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index 1e08155..2868eac 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -375,10 +375,11 @@ restore_my_cleanups (pmy_chain, chain) to arrange to free the object thus allocated. */ void -free_current_contents (location) - char **location; +free_current_contents (void *ptr) { - free (*location); + void **location = ptr; + if (*location != NULL) + free (*location); } /* Provide a known function that does nothing, to use as a base for |