Fix an error which caused 'free(): error: chunk is already free'

if an entry in the config file included flag 'G'.

MFC after:	3 weeks
This commit is contained in:
Garance A Drosehn 2003-02-26 03:20:38 +00:00
parent 7874f606d5
commit 5ac30d6d34
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111529

View File

@ -135,6 +135,7 @@ int
main(int argc, char **argv)
{
struct conf_entry *p, *q;
char *savglob;
glob_t pglob;
int i;
@ -150,11 +151,13 @@ main(int argc, char **argv)
if (glob(p->log, GLOB_NOCHECK, NULL, &pglob) != 0) {
warn("can't expand pattern: %s", p->log);
} else {
savglob = p->log;
for (i = 0; i < pglob.gl_matchc; i++) {
p->log = pglob.gl_pathv[i];
do_entry(p);
}
globfree(&pglob);
p->log = savglob;
}
}
p = p->next;