diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-12-10 20:27:47 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-12-10 20:27:47 +0000 |
commit | 9eb5d4f85893529cdca5a54796e344ecb6581196 (patch) | |
tree | f6078dc6aa0b2687219c6431ba7f872b4326c298 /usr.bin/cvs/watch.c | |
parent | cc2c3fa0314517ddf972b8ca44e9d25aee920bc1 (diff) |
switch to xmalloc stuff, me and xsa@ agreed on this a long
time ago, but we were being held back by jfb. too bad for him.
next step is to use fatal() through out the code for unrecoverable
errors instead of trying to be all nice and fluffy and reach main() again.
ok niallo@ and xsa@
Diffstat (limited to 'usr.bin/cvs/watch.c')
-rw-r--r-- | usr.bin/cvs/watch.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/usr.bin/cvs/watch.c b/usr.bin/cvs/watch.c index 9d4601c40d0..781bad239e1 100644 --- a/usr.bin/cvs/watch.c +++ b/usr.bin/cvs/watch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: watch.c,v 1.7 2005/10/17 16:16:00 moritz Exp $ */ +/* $OpenBSD: watch.c,v 1.8 2005/12/10 20:27:45 joris Exp $ */ /* * Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org> * Copyright (c) 2005 Moritz Jodeit <moritz@openbsd.org> @@ -123,10 +123,7 @@ cvs_watch_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) strcmp(optarg, "all") != 0 && strcmp(optarg, "none") != 0) return (CVS_EX_USAGE); - if ((aoptstr = strdup(optarg)) == NULL) { - cvs_log(LP_ERRNO, "failed to copy action"); - return (CVS_EX_DATA); - } + aoptstr = xstrdup(optarg); break; case 'l': cmd->file_flags &= ~CF_RECURSE; @@ -164,18 +161,18 @@ cvs_watch_pre_exec(struct cvsroot *root) (cvs_sendarg(root, "unedit", 0) < 0) || (cvs_sendarg(root, "-a", 0) < 0) || (cvs_sendarg(root, "commit", 0) < 0)) { - free(aoptstr); + xfree(aoptstr); return (CVS_EX_PROTO); } } else { if ((cvs_sendarg(root, "-a", 0) < 0) || (cvs_sendarg(root, aoptstr, 0) < 0)) { - free(aoptstr); + xfree(aoptstr); return (CVS_EX_PROTO); } } } - free(aoptstr); + xfree(aoptstr); return (CVS_EX_OK); } |