]> granicus.if.org Git - procps-ng/commitdiff
pidof: Do not memleak the contents of proc_t.
authorQualys Security Advisory <qsa@qualys.com>
Thu, 1 Jan 1970 00:00:00 +0000 (00:00 +0000)
committerCraig Small <csmall@enc.com.au>
Fri, 18 May 2018 21:32:21 +0000 (07:32 +1000)
Just like "pgrep: Do not memleak the contents of proc_t."

pidof.c

diff --git a/pidof.c b/pidof.c
index 8159147daf6238a25bf863bd9583f22ad891a6d8..e73c23e703bfeba5a3587478c257ace7e0d47744 100644 (file)
--- a/pidof.c
+++ b/pidof.c
@@ -158,7 +158,6 @@ static void select_procs (void)
                        safe_free(root_link);
 
                        if (!match) {  /* root check failed */
-                               memset (&task, 0, sizeof (task));
                                continue;
                        }
                }
@@ -233,8 +232,6 @@ static void select_procs (void)
                        }
 
                }
-
-               memset (&task, 0, sizeof (task));
        }
 
        closeproc (ptp);