From 77faf37562ec7fcc3ef5a05c270fc695db830fcb Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Thu, 31 Jan 2008 21:49:18 +0000 Subject: 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@ --- usr.bin/cvs/rcs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'usr.bin/cvs') 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 * 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); -- cgit v1.2.3