From 6b52b824688a08534d1ae924ea89d722df2ae079 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 4 May 2002 01:31:50 +0000 Subject: * size.c (display_archive): Add last_arfile and code to close archives. --- binutils/size.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'binutils/size.c') diff --git a/binutils/size.c b/binutils/size.c index 3da7520..961593b 100644 --- a/binutils/size.c +++ b/binutils/size.c @@ -316,6 +316,7 @@ display_archive (file) bfd *file; { bfd *arfile = (bfd *) NULL; + bfd *last_arfile = (bfd *) NULL; for (;;) { @@ -333,8 +334,14 @@ display_archive (file) } display_bfd (arfile); - /* Don't close the archive elements; we need them for next_archive. */ + + if (last_arfile != NULL) + bfd_close (last_arfile); + last_arfile = arfile; } + + if (last_arfile != NULL) + bfd_close (last_arfile); } static void -- cgit v1.1