From: jca Date: Mon, 19 May 2014 19:42:24 +0000 (+0000) Subject: Plug a small memory leak: if we pass checkin_init/checkin_update X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f3658d6be0ae06ab81fa93e431b7aa434333d684;p=openbsd Plug a small memory leak: if we pass checkin_init/checkin_update a revision thru pb.newrev, it will not be freed. From Fritjof Bornebusch, no objections from tech@ --- diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c index f8142d31d4e..842316642fb 100644 --- a/usr.bin/rcs/ci.c +++ b/usr.bin/rcs/ci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.216 2013/10/27 18:31:24 guenther Exp $ */ +/* $OpenBSD: ci.c,v 1.217 2014/05/19 19:42:24 jca Exp $ */ /* * Copyright (c) 2005, 2006 Niall O'Higgins * All rights reserved. @@ -287,7 +287,6 @@ checkin_main(int argc, char **argv) (void)fprintf(stderr, "%s <-- %s\n", pb.fpath, pb.filename); - /* XXX - Should we rcsnum_free(pb.newrev)? */ if (rev_str != NULL) if ((pb.newrev = rcs_getrevnum(rev_str, pb.file)) == NULL) @@ -315,6 +314,8 @@ checkin_main(int argc, char **argv) } rcs_close(pb.file); + if (rev_str != NULL) + rcsnum_free(pb.newrev); pb.newrev = NULL; }