aboutsummaryrefslogtreecommitdiff
path: root/bfd/opncls.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/opncls.c')
-rw-r--r--bfd/opncls.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/bfd/opncls.c b/bfd/opncls.c
index 9b91c2f..b280a13 100644
--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -58,15 +58,14 @@ FILE *bfd_open_file();
bfd *new_bfd()
{
- struct obstack tmp;
bfd *nbfd;
- obstack_begin(&tmp,128);
-
- nbfd = (bfd *)obstack_alloc(&tmp,sizeof(bfd));
- memset((PTR)nbfd, 0, sizeof (bfd)); /* Clear it */
- nbfd->memory = tmp;
+ nbfd = (bfd *)zalloc (sizeof (bfd));
+ if (!nbfd)
+ return 0;
+ obstack_begin(&nbfd->memory, 128);
+
nbfd->direction = no_direction;
nbfd->iostream = NULL;
nbfd->where = 0;