From: Sami Kerola Date: Sun, 20 Nov 2011 21:16:35 +0000 (+0100) Subject: pgrep: core dropped nearly always X-Git-Tag: v3.3.1~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e96bc377190f55b39eacf720e2f910446c4a42a;p=procps-ng pgrep: core dropped nearly always The do_regcomp() tries to free command line argument. Signed-off-by: Sami Kerola --- diff --git a/pgrep.c b/pgrep.c index 5492fa72..1627cef5 100644 --- a/pgrep.c +++ b/pgrep.c @@ -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);