* concat.c (reconcat): Fix for traditional C.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Tue, 25 Sep 2001 22:05:40 +0000 (22:05 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Tue, 25 Sep 2001 22:05:40 +0000 (22:05 +0000)
From-SVN: r45814

libiberty/ChangeLog
libiberty/concat.c

index 1c641169f3094bad67c870ed00f3acf1ae398527..27f218ee876d796e40718613eda9023a80cc245c 100644 (file)
@@ -1,3 +1,7 @@
+2001-09-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * concat.c (reconcat): Fix for traditional C.
+
 2001-09-24  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * concat.c (reconcat): New function.
index 136e8be866ebee04f7cf2e0536708d332b910778..cf026cf8f4cc1efeab9a4f5ab2f8d8b39e9df977 100644 (file)
@@ -188,10 +188,9 @@ reconcat VPARAMS ((char *optr, const char *first, ...))
   VA_FIXEDARG (args, char *, optr);
   VA_FIXEDARG (args, const char *, first);
   vconcat_copy (newstr, first, args);
-  VA_CLOSE (args);
-
-  if (optr)
+  if (optr) /* Done before VA_CLOSE so optr stays in scope for K&R C.  */
     free (optr);
+  VA_CLOSE (args);
 
   return newstr;
 }