aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2008-10-30 20:33:51 +0000
committerTom Tromey <tromey@redhat.com>2008-10-30 20:33:51 +0000
commita05016c09e47a026bdbf05d02101c4eb40ac52f5 (patch)
treedb70ad45d3953f1060a808ad8234a67e9db5d6de /gdb/utils.c
parent9fe4a2165de29f0802f0f9eb4801875e0f15c40a (diff)
downloadfsf-binutils-gdb-a05016c09e47a026bdbf05d02101c4eb40ac52f5.zip
fsf-binutils-gdb-a05016c09e47a026bdbf05d02101c4eb40ac52f5.tar.gz
fsf-binutils-gdb-a05016c09e47a026bdbf05d02101c4eb40ac52f5.tar.bz2
* utils.c (make_cleanup_close): Use make_cleanup_dtor.
(do_close_cleanup): Don't free 'fd'.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index f9a5f19..26d7933 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -244,7 +244,6 @@ do_close_cleanup (void *arg)
{
int *fd = arg;
close (*fd);
- xfree (fd);
}
struct cleanup *
@@ -252,7 +251,7 @@ make_cleanup_close (int fd)
{
int *saved_fd = xmalloc (sizeof (fd));
*saved_fd = fd;
- return make_cleanup (do_close_cleanup, saved_fd);
+ return make_cleanup_dtor (do_close_cleanup, saved_fd, xfree);
}
/* Helper function which does the work for make_cleanup_fclose. */