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:
Craig Small 2020-12-22 16:08:49 +11:00
parent 79196a0b9e
commit 5f859b30d3

View File

@ -716,6 +716,11 @@ static struct el * select_procs (int *num)
free(cmdsearch);
free(cmdoutput);
if (preg) {
regfree(preg);
free(preg);
}
return list;
}