From d5a7bb530d6ea294848fa3c95181dc48648a4f33 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 26 Jun 1997 17:53:57 +0000 Subject: * windres.c (main): Quit if we didn't get any resources. * rescoff.c (write_coff_file): Don't free the relocation array until after we've closed the BFD. --- binutils/ChangeLog | 6 ++++++ binutils/rescoff.c | 6 +++--- binutils/windres.c | 3 +++ 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'binutils') diff --git a/binutils/ChangeLog b/binutils/ChangeLog index fab29fa..a28f8cb 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +Thu Jun 26 13:53:17 1997 Ian Lance Taylor + + * windres.c (main): Quit if we didn't get any resources. + * rescoff.c (write_coff_file): Don't free the relocation array + until after we've closed the BFD. + Wed Jun 25 20:57:06 1997 Ian Lance Taylor * resbin.c: New file. diff --git a/binutils/rescoff.c b/binutils/rescoff.c index 0f83e54..6c7f21b 100644 --- a/binutils/rescoff.c +++ b/binutils/rescoff.c @@ -531,9 +531,6 @@ write_coff_file (filename, target, resources) bfd_set_reloc (abfd, sec, cwi.relocs, cwi.reloc_count); - /* We allocated the relocs array using malloc. */ - free (cwi.relocs); - offset = 0; for (d = cwi.dirs.d; d != NULL; d = d->next) { @@ -564,6 +561,9 @@ write_coff_file (filename, target, resources) if (! bfd_close (abfd)) bfd_fatal ("bfd_close"); + + /* We allocated the relocs array using malloc. */ + free (cwi.relocs); } /* Work out the sizes of the various fixed size resource directory diff --git a/binutils/windres.c b/binutils/windres.c index 3134b3d..f12d32e 100644 --- a/binutils/windres.c +++ b/binutils/windres.c @@ -960,6 +960,9 @@ main (argc, argv) break; } + if (resources == NULL) + fatal ("no resources"); + /* Sort the resources. This is required for COFF, convenient for rc, and unimportant for res. */ -- cgit v1.1