diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2007-10-18 12:13:21 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2007-10-18 12:13:21 +0000 |
commit | ae647d82e4b6735021bcb2964503fb3fb2c76985 (patch) | |
tree | eec09da1665a76a91b797fc6dfbe6c1747a88c4f /usr.bin | |
parent | 1c8f120dc9df0f7bdf0427418018e8d6a688f3ac (diff) |
Avoid memory leak if tag is defined multiple times in CVSROOT/config.
OK ray@, xsa@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/cvs/config.c b/usr.bin/cvs/config.c index 6dc7091603a..0c52093b34a 100644 --- a/usr.bin/cvs/config.c +++ b/usr.bin/cvs/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.10 2007/07/12 17:54:58 xsa Exp $ */ +/* $OpenBSD: config.c,v 1.11 2007/10/18 12:13:20 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -74,6 +74,8 @@ cvs_parse_configfile(void) *(val++) = '\0'; if (!strcmp(opt, "tag")) { + if (cvs_tagname != NULL) + xfree(cvs_tagname); cvs_tagname = xstrdup(val); } else if (!strcmp(opt, "umask")) { cvs_umask = (int)strtonum(val, 0, INT_MAX, &errstr); |