From: Qualys Security Advisory Date: Thu, 1 Jan 1970 00:00:00 +0000 (+0000) Subject: pidof: Do not memleak pidof_root if multiple -c options. X-Git-Tag: v3.3.15~123 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab8b3881a0b568edd137d4c0b51006ade04e93a0;p=procps-ng pidof: Do not memleak pidof_root if multiple -c options. --- diff --git a/pidof.c b/pidof.c index 7394c8a6..0220c888 100644 --- a/pidof.c +++ b/pidof.c @@ -318,6 +318,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;