mips64 rtype_to_howto error status
[deliverable/binutils-gdb.git] / binutils / ar.c
index 32ac4040c6b5f8ac933dc2bc33722e3a08b08e06..66a81e70c44bc11a26d93d6208ebe3ddf8fea46b 100644 (file)
@@ -1,5 +1,5 @@
 /* ar.c - Archive modify and extract.
-   Copyright (C) 1991-2017 Free Software Foundation, Inc.
+   Copyright (C) 1991-2018 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -747,6 +747,12 @@ main (int argc, char **argv)
     {
       bfd *arch;
 
+      /* Fail if no files are specified on the command line.
+        (But not for MRI mode which allows for reading arguments
+        and filenames from stdin).  */
+      if (argv[arg_index] == NULL)
+       usage (0);
+
       /* We don't use do_quick_append any more.  Too many systems
         expect ar to always rebuild the symbol table even when q is
         used.  */
@@ -1191,6 +1197,7 @@ write_archive (bfd *iarch)
   if (smart_rename (new_name, old_name, 0) != 0)
     xexit (1);
   free (old_name);
+  free (new_name);
 }
 
 /* Return a pointer to the pointer to the entry which should be rplacd'd
This page took 0.031445 seconds and 4 git commands to generate.