From: Qualys Security Advisory Date: Thu, 1 Jan 1970 00:00:00 +0000 (+0000) Subject: 0019-pidof: Do not memleak pidof_root if multiple -c options. X-Git-Tag: v4.0.0~511 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4abe4a51a066af43e8ac3439f4acdbf0cc687a36;p=procps-ng 0019-pidof: Do not memleak pidof_root if multiple -c options. --- diff --git a/pidof.c b/pidof.c index 509bafac..c65aaadb 100644 --- a/pidof.c +++ b/pidof.c @@ -324,6 +324,7 @@ int main (int argc, char **argv) case 'c': if (geteuid() == 0) { opt_rootdir_check = 1; + safe_free(pidof_root); pidof_root = pid_link(getpid(), "root"); } break;