pgrep: Remove memory leak
This is part of !118 where @tt.rantala found a memory leak. The other part of !118 may come later if the performance change is significant. References: procps-ng/procps!118
This commit is contained in:
parent
e7c3c0279f
commit
048820fde3
5
pgrep.c
5
pgrep.c
@ -663,6 +663,11 @@ static struct el * select_procs (int *num)
|
|||||||
free(cmdsearch);
|
free(cmdsearch);
|
||||||
free(cmdoutput);
|
free(cmdoutput);
|
||||||
|
|
||||||
|
if (preg) {
|
||||||
|
regfree(preg);
|
||||||
|
free(preg);
|
||||||
|
}
|
||||||
|
|
||||||
*num = matches;
|
*num = matches;
|
||||||
|
|
||||||
if ((!matches) && (!opt_full) && opt_pattern && (strlen(opt_pattern) > 15))
|
if ((!matches) && (!opt_full) && opt_pattern && (strlen(opt_pattern) > 15))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user