diff options
author | 2008-01-31 21:49:17 +0000 | |
---|---|---|
committer | 2008-01-31 21:49:17 +0000 | |
commit | 6eb929a09d5b6f2bf62e65a55e6414f2b8ef4adc (patch) | |
tree | 329ae46bc2984c8a1c9596f198e93317d6a91dfc /usr.bin/cvs | |
parent | remove dead and unreachable code (diff) | |
download | wireguard-openbsd-6eb929a09d5b6f2bf62e65a55e6414f2b8ef4adc.tar.xz wireguard-openbsd-6eb929a09d5b6f2bf62e65a55e6414f2b8ef4adc.zip |
in some cases we did not return a copy of the resulting RCSNUM
towards the caller, which expects a copy (and frees it when done).
ok tobias@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/rcs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index cb40f5f365b..0f2bb2306bd 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.241 2008/01/31 20:29:16 joris Exp $ */ +/* $OpenBSD: rcs.c,v 1.242 2008/01/31 21:49:17 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -2645,8 +2645,11 @@ rcs_translate_tag(const char *revstr, RCSFILE *rfp) /* Possibly we could be passed a version number */ if ((rev = rcsnum_parse(revstr)) != NULL) { /* Do not return if it is not in RCS file */ - if ((rdp = rcs_findrev(rfp, rev)) != NULL) - return (rev); + if ((rdp = rcs_findrev(rfp, rev)) != NULL) { + frev = rcsnum_alloc(); + rcsnum_cpy(rev, frev, 0); + return (frev); + } } else { /* More likely we will be passed a symbol */ rev = rcs_sym_getrev(rfp, revstr); |