=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/modules.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- src/usr.bin/cvs/modules.c 2008/02/06 22:43:22 1.10 +++ src/usr.bin/cvs/modules.c 2008/02/26 20:20:49 1.11 @@ -1,4 +1,4 @@ -/* $OpenBSD: modules.c,v 1.10 2008/02/06 22:43:22 joris Exp $ */ +/* $OpenBSD: modules.c,v 1.11 2008/02/26 20:20:49 joris Exp $ */ /* * Copyright (c) 2008 Joris Vink * @@ -57,6 +57,7 @@ char *bline, *val, *p, *module, *sp, *dp; char *dirname, fpath[MAXPATHLEN], *prog; + prog = NULL; bline = xstrdup(line); flags = 0; @@ -80,7 +81,6 @@ while (!isspace(*p) && *p != '\0') p++; - prog = NULL; while (val[0] == '-') { p = val; while (!isspace(*p) && *p != '\0') @@ -95,14 +95,14 @@ case 'a': if (flags & MODULE_TARGETDIR) { cvs_log(LP_NOTICE, "cannot use -a with -d"); - return; + goto bad; } flags |= MODULE_ALIAS; break; case 'd': if (flags & MODULE_ALIAS) { cvs_log(LP_NOTICE, "cannot use -d with -a"); - return; + goto bad; } flags |= MODULE_TARGETDIR; break; @@ -113,7 +113,7 @@ if (flags != 0 || prog != NULL) { cvs_log(LP_NOTICE, "-o cannot be used with other flags"); - return; + goto bad; } val = p; @@ -131,7 +131,7 @@ if (flags != 0 || prog != NULL) { cvs_log(LP_NOTICE, "-i cannot be used with other flags"); - return; + goto bad; } if ((val = strchr(p, ' ' )) == NULL) @@ -202,6 +202,9 @@ return; bad: + if (prog != NULL) + xfree(prog); + xfree(bline); cvs_log(LP_NOTICE, "malformed line in CVSROOT/modules: %d", lineno); } @@ -215,7 +218,6 @@ TAILQ_FOREACH(mi, &modules, m_list) { if (!strcmp(name, mi->mi_name)) { - mc = xmalloc(sizeof(*mc)); mc->mc_modules = mi->mi_modules; mc->mc_ignores = mi->mi_ignores; mc->mc_canfree = 0;