return make_my_cleanup (&cleanup_chain, do_freeargv, arg);
}
+static void
+do_bfd_close_cleanup (void *arg)
+{
+ bfd_close (arg);
+}
+
+struct cleanup *
+make_cleanup_bfd_close (bfd *abfd)
+{
+ return make_cleanup (do_bfd_close_cleanup, abfd);
+}
+
static void
do_ui_file_delete (void *arg)
{
free_current_contents (void *ptr)
{
void **location = ptr;
+ if (location == NULL)
+ internal_error ("free_current_contents: NULL pointer");
if (*location != NULL)
- free (*location);
+ {
+ free (*location);
+ *location = NULL;
+ }
}
/* Provide a known function that does nothing, to use as a base for