aboutsummaryrefslogtreecommitdiff
path: root/libiberty/concat.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2001-09-25 22:05:40 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2001-09-25 22:05:40 +0000
commitc176688132f1f85ad9d612a142e488ed436d0464 (patch)
tree62cb43e30c546c2f226241b25ba952e4e71512cd /libiberty/concat.c
parentb499d9ab48224a8331ee6553e8fdf7becaec26bd (diff)
downloadgcc-c176688132f1f85ad9d612a142e488ed436d0464.zip
gcc-c176688132f1f85ad9d612a142e488ed436d0464.tar.gz
gcc-c176688132f1f85ad9d612a142e488ed436d0464.tar.bz2
* concat.c (reconcat): Fix for traditional C.
From-SVN: r45814
Diffstat (limited to 'libiberty/concat.c')
-rw-r--r--libiberty/concat.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libiberty/concat.c b/libiberty/concat.c
index 136e8be..cf026cf 100644
--- a/libiberty/concat.c
+++ b/libiberty/concat.c
@@ -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;
}