pgrep: core dropped nearly always

The do_regcomp() tries to free command line argument.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2011-11-20 22:16:35 +01:00
parent 64b420936e
commit 2e96bc3771

View File

@ -409,7 +409,8 @@ static regex_t * do_regcomp (void)
}
re_err = regcomp (preg, re, REG_EXTENDED | REG_NOSUB | opt_case);
free(re);
if (opt_exact)
free(re);
if (re_err) {
regerror (re_err, preg, errbuf, sizeof(errbuf));
fputs(errbuf,stderr);