* windres.c (main): Quit if we didn't get any resources.
authorIan Lance Taylor <ian@airs.com>
Thu, 26 Jun 1997 17:53:57 +0000 (17:53 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 26 Jun 1997 17:53:57 +0000 (17:53 +0000)
* rescoff.c (write_coff_file): Don't free the relocation array
until after we've closed the BFD.

binutils/ChangeLog
binutils/rescoff.c
binutils/windres.c

index fab29fab55bb644993c97c0e5c9bdf56d5630936..a28f8cb61e7892942e2f9e4b1cadb8c5cad045ca 100644 (file)
@@ -1,3 +1,9 @@
+Thu Jun 26 13:53:17 1997  Ian Lance Taylor  <ian@cygnus.com>
+
+       * 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  <ian@cygnus.com>
 
        * resbin.c: New file.
index 0f83e545d99328bbc05ad2f828ceb42644b624e3..6c7f21b15e3d4cd18a6b8d9169c4ef5c67e5bfdb 100644 (file)
@@ -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
index 3134b3d7270932ac7a4201310e5fd26affbb71dd..f12d32ecc92ae1abdf921260ceb9a382a03f69df 100644 (file)
@@ -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.  */
 
This page took 0.029238 seconds and 4 git commands to generate.