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:
parent
64b420936e
commit
2e96bc3771
3
pgrep.c
3
pgrep.c
@ -409,7 +409,8 @@ static regex_t * do_regcomp (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
re_err = regcomp (preg, re, REG_EXTENDED | REG_NOSUB | opt_case);
|
re_err = regcomp (preg, re, REG_EXTENDED | REG_NOSUB | opt_case);
|
||||||
free(re);
|
if (opt_exact)
|
||||||
|
free(re);
|
||||||
if (re_err) {
|
if (re_err) {
|
||||||
regerror (re_err, preg, errbuf, sizeof(errbuf));
|
regerror (re_err, preg, errbuf, sizeof(errbuf));
|
||||||
fputs(errbuf,stderr);
|
fputs(errbuf,stderr);
|
||||||
|
Loading…
Reference in New Issue
Block a user