diff options
author | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2014-05-19 19:42:25 +0000 |
---|---|---|
committer | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2014-05-19 19:42:25 +0000 |
commit | cc01ff69c2cebfffcc95695cd0374f5fc472f8ae (patch) | |
tree | affd57d3d7fe269ac2791b96fb93db9a5733aac8 | |
parent | cb30010d8ff1d824237c29d3913a08e5544faadf (diff) |
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@
-rw-r--r-- | usr.bin/rcs/ci.c | 5 |
1 files changed, 3 insertions, 2 deletions
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 <niallo@openbsd.org> * 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; } |