aboutsummaryrefslogtreecommitdiff
path: root/libiberty/concat.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2001-09-25 23:02:03 +0000
committerDJ Delorie <dj@redhat.com>2001-09-25 23:02:03 +0000
commit66c94e19fcc26fe6df70610769923f990ad9f187 (patch)
tree5177d8e06e9744c84ff056531fd801f6dbe29576 /libiberty/concat.c
parente62de969f096f87e79a62eca52968460dcf1226f (diff)
downloadgdb-66c94e19fcc26fe6df70610769923f990ad9f187.zip
gdb-66c94e19fcc26fe6df70610769923f990ad9f187.tar.gz
gdb-66c94e19fcc26fe6df70610769923f990ad9f187.tar.bz2
merge from gcc
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;
}