summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-01-25 19:32:57 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-01-25 19:32:57 +0000
commit9448578837713969e6be8d697163128619e102c5 (patch)
treee37e1d45be0c0bb20cf495940a952d33a9add0ba /usr.bin/cvs
parent8fba15145e83aae3f67d3bd544aa5bfd99108970 (diff)
plug a leak if multiple expansions are done on a single line. ok
niallo@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/rcs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index bd0a67a9519..926bc28e380 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.202 2007/01/25 18:35:30 niallo Exp $ */
+/* $OpenBSD: rcs.c,v 1.203 2007/01/25 19:32:56 otto Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -3104,6 +3104,8 @@ rcs_kwexp_line(char *rcsfile, struct rcs_delta *rdp, struct cvs_line *line,
len = cvs_buf_len(tmpbuf);
/* tmpbuf is now ready, convert to string */
+ if (line->l_needsfree)
+ xfree(line->l_line);
line->l_len = len;
line->l_line = cvs_buf_release(tmpbuf);
line->l_needsfree = 1;