mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-31 01:45:52 +08:00
* utils.c (make_cleanup_close): Use make_cleanup_dtor.
(do_close_cleanup): Don't free 'fd'.
This commit is contained in:
@ -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. */
|
||||
|
Reference in New Issue
Block a user