diff --git a/pgrep.c b/pgrep.c index 205a1db6..4fe5e8a0 100644 --- a/pgrep.c +++ b/pgrep.c @@ -716,6 +716,11 @@ static struct el * select_procs (int *num) free(cmdsearch); free(cmdoutput); + if (preg) { + regfree(preg); + free(preg); + } + return list; }