(do_close_cleanup): Don't free 'fd'.
+2008-10-30 Tom Tromey <tromey@redhat.com>
+
+ * utils.c (make_cleanup_close): Use make_cleanup_dtor.
+ (do_close_cleanup): Don't free 'fd'.
+
2008-10-28 Tom Tromey <tromey@redhat.com>
* source.c (symtab_to_fullname): Test 'r >= 0'.
{
int *fd = arg;
close (*fd);
- xfree (fd);
}
struct cleanup *
{
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. */