diff options
| author | 2005-03-02 03:05:02 +0000 | |
|---|---|---|
| committer | 2005-03-02 03:05:02 +0000 | |
| commit | ff81637dcf402f29aef00c54139dc03fc449fbd8 (patch) | |
| tree | b36f5cbaaa4bb8b20f6dfd4b31e086fd67ab203f /usr.bin/cvs/commit.c | |
| parent | bz#987: mention ForwardX11Trusted in ssh.1, (diff) | |
| download | wireguard-openbsd-ff81637dcf402f29aef00c54139dc03fc449fbd8.tar.xz wireguard-openbsd-ff81637dcf402f29aef00c54139dc03fc449fbd8.zip | |
- make sure we are using a remote method before calling
cvs_sendreq() and cvs_sendfile().
- don't leak entp on errors.
ok jfb@
Diffstat (limited to 'usr.bin/cvs/commit.c')
| -rw-r--r-- | usr.bin/cvs/commit.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index 769d14fb14e..821d9680a67 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.15 2005/02/22 23:34:28 jfb Exp $ */ +/* $OpenBSD: commit.c,v 1.16 2005/03/02 03:05:02 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -213,16 +213,23 @@ cvs_commit_file(CVSFILE *cf, void *arg) if ((cf->cf_cvstat == CVS_FST_ADDED) || (cf->cf_cvstat == CVS_FST_MODIFIED)) { - if ((root->cr_method != CVS_METHOD_LOCAL) && - (cvs_sendentry(root, entp) < 0)) { - cvs_ent_free(entp); - return (-1); - } + if (root->cr_method != CVS_METHOD_LOCAL) { + if (cvs_sendentry(root, entp) < 0) { + cvs_ent_free(entp); + return (-1); + } - if ((cvs_sendreq(root, CVS_REQ_MODIFIED, - CVS_FILE_NAME(cf)) < 0) || - (cvs_sendfile(root, fpath) < 0)) - return (-1); + if (cvs_sendreq(root, CVS_REQ_MODIFIED, + CVS_FILE_NAME(cf)) < 0) { + cvs_ent_free(entp); + return (-1); + } + + if (cvs_sendfile(root, fpath) < 0) { + cvs_ent_free(entp); + return (-1); + } + } } snprintf(rcspath, sizeof(rcspath), "%s/%s/%s%s", |
