pidof: Do not memleak pidof_root if multiple -c options.

This commit is contained in:
Qualys Security Advisory 1970-01-01 00:00:00 +00:00 committed by Craig Small
parent bba9f384c0
commit ab8b3881a0

View File

@ -318,6 +318,7 @@ int main (int argc, char **argv)
case 'c': case 'c':
if (geteuid() == 0) { if (geteuid() == 0) {
opt_rootdir_check = 1; opt_rootdir_check = 1;
safe_free(pidof_root);
pidof_root = pid_link(getpid(), "root"); pidof_root = pid_link(getpid(), "root");
} }
break; break;