/* vms.c -- BFD back-end for VAX (openVMS/VAX) and
EVAX (openVMS/Alpha) files.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007 Free Software Foundation, Inc.
+ 2006, 2007, 2008 Free Software Foundation, Inc.
Written by Klaus K"ampf (kkaempf@rmi.de)
#if VMS_DEBUG
vms_debug (1, "vms_close_and_cleanup (%p)\n", abfd);
#endif
- if (abfd == NULL)
+ if (abfd == NULL
+ || abfd->tdata.any == NULL)
return TRUE;
if (PRIV (vms_buf) != NULL)
{
bfd_size_type amt = section_count;
amt *= sizeof (asection *);
- PRIV (sections) = bfd_realloc (PRIV (sections), amt);
+ PRIV (sections) = bfd_realloc_or_free (PRIV (sections), amt);
if (PRIV (sections) == NULL)
return FALSE;
PRIV (section_count) = section_count;