Fix RX and M68HC11 linker testsuite failures.
[external/binutils.git] / binutils / nlmconv.c
index 751cf08..eff15c5 100644 (file)
@@ -1,5 +1,5 @@
 /* nlmconv.c -- NLM conversion program
-   Copyright (C) 1993-2015 Free Software Foundation, Inc.
+   Copyright (C) 1993-2016 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -2082,7 +2082,7 @@ link_inputs (struct string_list *inputs, char *ld, char * mfile)
   for (q = inputs; q != NULL; q = q->next)
     ++c;
 
-  argv = (char **) alloca ((c + 7) * sizeof (char *));
+  argv = (char **) xmalloc ((c + 7) * sizeof (char *));
 
 #ifndef __MSDOS__
   if (ld == NULL)
@@ -2140,6 +2140,8 @@ link_inputs (struct string_list *inputs, char *ld, char * mfile)
 
   pid = pexecute (ld, argv, program_name, (char *) NULL, &errfmt, &errarg,
                  PEXECUTE_SEARCH | PEXECUTE_ONE);
+  free (argv);
+
   if (pid == -1)
     {
       fprintf (stderr, _("%s: execution of %s failed: "), program_name, ld);