summaryrefslogtreecommitdiff
path: root/usr.bin/rcs
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2010-09-02 00:21:42 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2010-09-02 00:21:42 +0000
commitb03b3682b06ecf710c3955f73b2aa98ae0aa2b43 (patch)
treec4f84955b53ae1f2180e302bd365cb7607a409bf /usr.bin/rcs
parent1a34d6aa784d2a157d6bc04ff7448e0648ec180d (diff)
rcsnum_parse() allocates already an RCSNUM struct, so it's not needed to
copy it into a newly allocated one (which is even a memory leak). ok zinovik
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r--usr.bin/rcs/rcs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c
index d6cee8d0eb6..f69955bf459 100644
--- a/usr.bin/rcs/rcs.c
+++ b/usr.bin/rcs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.61 2010/08/31 20:43:45 tobias Exp $ */
+/* $OpenBSD: rcs.c,v 1.62 2010/09/02 00:21:41 tobias Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -1359,8 +1359,7 @@ rcs_rev_add(RCSFILE *rf, RCSNUM *rev, const char *msg, time_t date,
if (rf->rf_flags & RCS_CREATE) {
if ((rev = rcsnum_parse(RCS_HEAD_INIT)) == NULL)
return (-1);
- rf->rf_head = rcsnum_alloc();
- rcsnum_cpy(rev, rf->rf_head, 0);
+ rf->rf_head = rev;
} else {
rev = rcsnum_inc(rf->rf_head);
}