summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/commit.c
diff options
context:
space:
mode:
authorjoris <joris@openbsd.org>2005-03-29 15:06:01 +0000
committerjoris <joris@openbsd.org>2005-03-29 15:06:01 +0000
commitc2799585b7d60facaa8451025d5a5405f3e5cd19 (patch)
tree08daea083f81c27c0763a9c58e5f51d61a3ea55c /usr.bin/cvs/commit.c
parentbe more verbose when cleaning up the string table. (diff)
downloadwireguard-openbsd-c2799585b7d60facaa8451025d5a5405f3e5cd19.tar.xz
wireguard-openbsd-c2799585b7d60facaa8451025d5a5405f3e5cd19.zip
fix memleak
ok jfb@
Diffstat (limited to 'usr.bin/cvs/commit.c')
-rw-r--r--usr.bin/cvs/commit.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c
index 821d9680a67..2375cb8080c 100644
--- a/usr.bin/cvs/commit.c
+++ b/usr.bin/cvs/commit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commit.c,v 1.16 2005/03/02 03:05:02 joris Exp $ */
+/* $OpenBSD: commit.c,v 1.17 2005/03/29 15:06:01 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -59,6 +59,7 @@ cvs_commit(int argc, char **argv)
int i, ch, flags;
char *mfile;
struct cvs_flist cl;
+ CVSFILE *cfp;
struct cvsroot *root;
flags = CF_RECURSE|CF_IGNORE|CF_SORT;
@@ -115,13 +116,19 @@ cvs_commit(int argc, char **argv)
if (TAILQ_EMPTY(&cl))
return (0);
- if (cvs_msg == NULL) {
+ if (cvs_msg == NULL)
cvs_msg = cvs_logmsg_get(CVS_FILE_NAME(cvs_files),
NULL, &cl, NULL);
- if (cvs_msg == NULL)
- return (1);
+
+ while (!TAILQ_EMPTY(&cl)) {
+ cfp = TAILQ_FIRST(&cl);
+ TAILQ_REMOVE(&cl, cfp, cf_list);
+ cvs_file_free(cfp);
}
+ if (cvs_msg == NULL)
+ return (1);
+
root = CVS_DIR_ROOT(cvs_files);
if (root == NULL) {
cvs_log(LP_ERR,