diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-03-29 15:06:02 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-03-29 15:06:02 +0000 |
commit | dec77e5fce736cb179c5aa83c50bb9e4e31b7f7a (patch) | |
tree | aca97dad5e1e8536f22e28710ac9ad8ebc410777 /usr.bin/cvs | |
parent | 5431cf3f171d63079e56d3ddb6c147be4b07cf6d (diff) |
fix memleak
ok jfb@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/commit.c | 15 |
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, |